Skip to content

Commit 0d74adb

Browse files
authored
Merge branch 'main' into fix/auto-rename-wait-status
2 parents f6e5578 + 09f7c88 commit 0d74adb

35 files changed

Lines changed: 1129 additions & 35 deletions

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ require (
4545
github.com/klauspost/pgzip v1.2.6 // indirect
4646
github.com/mikelolasagasti/xz v1.0.1 // indirect
4747
github.com/minio/minlz v1.0.1 // indirect
48+
github.com/monkeyWie/goed2k v0.0.0-20260317100435-7a7575cf2447 // indirect
4849
github.com/nwaples/rardecode/v2 v2.2.0 // indirect
4950
github.com/onsi/ginkgo/v2 v2.23.4 // indirect
5051
github.com/pierrec/lz4/v4 v4.1.22 // indirect

go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,10 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ
386386
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
387387
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
388388
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
389+
github.com/monkeyWie/goed2k v0.0.0-20260317094144-6e18d43056e5 h1:tEOucyKJzFsCz5Gr41jFHj8i2g1zemTyS4uyErJgFHc=
390+
github.com/monkeyWie/goed2k v0.0.0-20260317094144-6e18d43056e5/go.mod h1:Ry2y1QlzerUgA1hVmExBdXXzE4Sjk1M7w0nSh6dhDOg=
391+
github.com/monkeyWie/goed2k v0.0.0-20260317100435-7a7575cf2447 h1:88kRsNwkDKPA4NzRUWdOoIL7SyMNDwtmAxzShKBvKTI=
392+
github.com/monkeyWie/goed2k v0.0.0-20260317100435-7a7575cf2447/go.mod h1:Ry2y1QlzerUgA1hVmExBdXXzE4Sjk1M7w0nSh6dhDOg=
389393
github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o=
390394
github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc=
391395
github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg=

internal/fetcher/fetcher.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,21 @@ type FetcherManager interface {
127127
Close() error
128128
}
129129

130+
// StatefulFetcherManager is an optional extension for protocols that keep
131+
// shared client state outside individual task fetchers.
132+
type StatefulFetcherManager interface {
133+
SetStateStore(store ProtocolStateStore)
134+
}
135+
136+
// ProtocolStateStore persists shared protocol state for a fetcher manager.
137+
// Downloader provides the concrete storage backend, while the protocol decides
138+
// when state should be loaded or flushed.
139+
type ProtocolStateStore interface {
140+
Load(v any) (bool, error)
141+
Save(v any) error
142+
Delete() error
143+
}
144+
130145
type DefaultFetcher struct {
131146
Ctl *controller.Controller
132147
Meta *FetcherMeta

internal/protocol/ed2k/config.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package ed2k
2+
3+
const (
4+
defaultServerList = "45.82.80.155:5687,176.123.5.89:4725,85.121.5.137:4232,176.123.2.239:4232,145.239.2.134:4661,91.208.162.87:4232,37.15.61.236:4232"
5+
defaultServerMet = "ed2k://|serverlist|http://upd.emule-security.org/server.met|/"
6+
defaultNodesDat = "https://upd.emule-security.org/nodes.dat"
7+
)
8+
9+
type config struct {
10+
ListenPort int `json:"listenPort"`
11+
UDPPort int `json:"udpPort"`
12+
ServerAddr string `json:"serverAddr"`
13+
ServerMet string `json:"serverMet"`
14+
NodesDat string `json:"nodesDat"`
15+
}

0 commit comments

Comments
 (0)