mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-24 07:28:27 +00:00
Fix linux/freebsd/windows compilation
This commit is contained in:
parent
d7cc48eab2
commit
4f6ee7c8eb
@ -12,22 +12,22 @@ type nativeModel struct {
|
|||||||
next Model
|
next Model
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m nativeModel) Index(nodeID string, repo string, files []FileInfo) {
|
func (m nativeModel) Index(nodeID NodeID, repo string, files []FileInfo) {
|
||||||
m.next.Index(nodeID, repo, files)
|
m.next.Index(nodeID, repo, files)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m nativeModel) IndexUpdate(nodeID string, repo string, files []FileInfo) {
|
func (m nativeModel) IndexUpdate(nodeID NodeID, repo string, files []FileInfo) {
|
||||||
m.next.IndexUpdate(nodeID, repo, files)
|
m.next.IndexUpdate(nodeID, repo, files)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m nativeModel) Request(nodeID, repo string, name string, offset int64, size int) ([]byte, error) {
|
func (m nativeModel) Request(nodeID NodeID, repo string, name string, offset int64, size int) ([]byte, error) {
|
||||||
return m.next.Request(nodeID, repo, name, offset, size)
|
return m.next.Request(nodeID, repo, name, offset, size)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m nativeModel) ClusterConfig(nodeID string, config ClusterConfigMessage) {
|
func (m nativeModel) ClusterConfig(nodeID NodeID, config ClusterConfigMessage) {
|
||||||
m.next.ClusterConfig(nodeID, config)
|
m.next.ClusterConfig(nodeID, config)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m nativeModel) Close(nodeID string, err error) {
|
func (m nativeModel) Close(nodeID NodeID, err error) {
|
||||||
m.next.Close(nodeID, err)
|
m.next.Close(nodeID, err)
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ type nativeModel struct {
|
|||||||
next Model
|
next Model
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m nativeModel) Index(nodeID string, repo string, files []FileInfo) {
|
func (m nativeModel) Index(nodeID NodeID, repo string, files []FileInfo) {
|
||||||
for i, f := range files {
|
for i, f := range files {
|
||||||
if strings.ContainsAny(f.Name, disallowedCharacters) {
|
if strings.ContainsAny(f.Name, disallowedCharacters) {
|
||||||
files[i].Flags |= FlagInvalid
|
files[i].Flags |= FlagInvalid
|
||||||
@ -37,7 +37,7 @@ func (m nativeModel) Index(nodeID string, repo string, files []FileInfo) {
|
|||||||
m.next.Index(nodeID, repo, files)
|
m.next.Index(nodeID, repo, files)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m nativeModel) IndexUpdate(nodeID string, repo string, files []FileInfo) {
|
func (m nativeModel) IndexUpdate(nodeID NodeID, repo string, files []FileInfo) {
|
||||||
for i, f := range files {
|
for i, f := range files {
|
||||||
if strings.ContainsAny(f.Name, disallowedCharacters) {
|
if strings.ContainsAny(f.Name, disallowedCharacters) {
|
||||||
files[i].Flags |= FlagInvalid
|
files[i].Flags |= FlagInvalid
|
||||||
@ -48,15 +48,15 @@ func (m nativeModel) IndexUpdate(nodeID string, repo string, files []FileInfo) {
|
|||||||
m.next.IndexUpdate(nodeID, repo, files)
|
m.next.IndexUpdate(nodeID, repo, files)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m nativeModel) Request(nodeID, repo string, name string, offset int64, size int) ([]byte, error) {
|
func (m nativeModel) Request(nodeID NodeID, repo string, name string, offset int64, size int) ([]byte, error) {
|
||||||
name = filepath.FromSlash(name)
|
name = filepath.FromSlash(name)
|
||||||
return m.next.Request(nodeID, repo, name, offset, size)
|
return m.next.Request(nodeID, repo, name, offset, size)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m nativeModel) ClusterConfig(nodeID string, config ClusterConfigMessage) {
|
func (m nativeModel) ClusterConfig(nodeID NodeID, config ClusterConfigMessage) {
|
||||||
m.next.ClusterConfig(nodeID, config)
|
m.next.ClusterConfig(nodeID, config)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m nativeModel) Close(nodeID string, err error) {
|
func (m nativeModel) Close(nodeID NodeID, err error) {
|
||||||
m.next.Close(nodeID, err)
|
m.next.Close(nodeID, err)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user