proxy-pool/internal/domain/ownership/snapshot.go
youfak 51fef78368
Some checks are pending
ci / proto (push) Waiting to run
ci / test (ubuntu-latest) (push) Waiting to run
ci / test (windows-latest) (push) Waiting to run
ci / race (push) Waiting to run
ci / integration (push) Waiting to run
feat: build worker proxy snapshots from ownership
2026-07-31 14:27:08 +08:00

23 lines
632 B
Go

package ownership
import (
"context"
"time"
proxyDomain "proxy-pool/internal/domain/proxy"
)
// SnapshotProxy is one currently assignable proxy in a Worker-specific view.
// LeaseExpiresAt bounds how long the view may remain valid without refresh.
type SnapshotProxy struct {
Proxy proxyDomain.Proxy
OwnershipEpoch uint64
LeaseExpiresAt time.Time
}
// SnapshotReader returns a complete bounded Worker view. Implementations must
// never silently truncate the result when the requested limit is exceeded.
type SnapshotReader interface {
ReadWorkerSnapshot(context.Context, string, int) ([]SnapshotProxy, error)
}