nativemodel_windows.go 949 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. // +build windows
  2. package protocol
  3. // Windows uses backslashes as file separator
  4. import "path/filepath"
  5. type nativeModel struct {
  6. next Model
  7. }
  8. func (m nativeModel) Index(nodeID string, repo string, files []FileInfo) {
  9. for i := range files {
  10. files[i].Name = filepath.FromSlash(files[i].Name)
  11. }
  12. m.next.Index(nodeID, repo, files)
  13. }
  14. func (m nativeModel) IndexUpdate(nodeID string, repo string, files []FileInfo) {
  15. for i := range files {
  16. files[i].Name = filepath.FromSlash(files[i].Name)
  17. }
  18. m.next.IndexUpdate(nodeID, repo, files)
  19. }
  20. func (m nativeModel) Request(nodeID, repo string, name string, offset int64, size int) ([]byte, error) {
  21. name = filepath.FromSlash(name)
  22. return m.next.Request(nodeID, repo, name, offset, size)
  23. }
  24. func (m nativeModel) ClusterConfig(nodeID string, config ClusterConfigMessage) {
  25. m.next.ClusterConfig(nodeID, config)
  26. }
  27. func (m nativeModel) Close(nodeID string, err error) {
  28. m.next.Close(nodeID, err)
  29. }