Versions in this module Expand all Collapse all v0 v0.1.0 Nov 9, 2026 Changes in this version + const KindGlobal + const KindMeta + const KindPackage + const KindPlugin + const KindProvider + const KindSource + const SolverByparr + const SolverFlareSolverr + const UAFixed + const UAFromSolver + const UAPluginDefault + const UARandomDesktop + const UnsetHash + var ErrIDTaken = errors.New("network: the ID is taken") + var ErrInUse = errors.New("network: in use by a network profile") + var ErrInvalidID = errors.New("network: IDs are lowercase letters, digits, '-' and '_', up to 40") + var ErrNotFound = errors.New("network: not found") + var ErrNotShared = errors.New("network: a custom profile can only be assigned to its owner") + func Hash(m proto.Message) string + type Assignment struct + Kind string + ProfileID string + TargetID string + UpdatedAt time.Time + func (a Assignment) PluginDefault() bool + type Effective struct + Level string + ProfileID string + type InvalidError struct + Field string + Reason string + func (e *InvalidError) Error() string + type MetaPusher interface + Assignments func(ctx context.Context) ([]*metav1.Assignment, error) + PushProfile func(ctx context.Context, provider string, p *metadatav1.NetworkProfile) error + type Owner struct + ID string + Kind string + type Profile struct + Concurrency int + CreatedAt time.Time + DoHURL string + Headers map[string]string + ID string + Name string + Owner *Owner + ProxyID string + RateLimit *RateLimit + SharedCookieJar string + SolverID string + Timeouts Timeouts + UpdatedAt time.Time + UserAgent string + UserAgentMode string + type Proxy struct + CreatedAt time.Time + HasPassword bool + ID string + Name string + Owner *Owner + URL string + UpdatedAt time.Time + Username string + type ProxyInput struct + ID string + Name string + Owner *Owner + Password string + URL string + Username string + type ProxyPatch struct + Name *string + Password *string + URL *string + Username *string + type Push = db.NetworkPush + type RateLimit struct + Burst int + Period time.Duration + Requests int + Scope string + type Resolver struct + func (r *Resolver) Assigned(kind, id string) (Assignment, bool) + func (r *Resolver) Provider(id string) Effective + func (r *Resolver) Source(sourceID, pluginID, packageID string) Effective + type Service struct + func New(st *store.Store, box *secret.Box, log *slog.Logger) *Service + func (s *Service) Assign(ctx context.Context, kind, id, profileID string) (Assignment, error) + func (s *Service) Assignments(ctx context.Context) ([]Assignment, error) + func (s *Service) CreateProfile(ctx context.Context, p Profile) (Profile, error) + func (s *Service) CreateProxy(ctx context.Context, in ProxyInput) (Proxy, error) + func (s *Service) CreateSolver(ctx context.Context, in Solver) (Solver, error) + func (s *Service) DeleteProfile(ctx context.Context, id string) error + func (s *Service) DeleteProxy(ctx context.Context, id string) error + func (s *Service) DeleteSolver(ctx context.Context, id string) error + func (s *Service) MetaProfile(ctx context.Context, id string) (*metadatav1.NetworkProfile, error) + func (s *Service) Profile(ctx context.Context, id string) (Profile, error) + func (s *Service) Profiles(ctx context.Context, owner *Owner, withCustom bool) ([]Profile, error) + func (s *Service) Proxies(ctx context.Context, owner *Owner, withCustom bool) ([]Proxy, error) + func (s *Service) Proxy(ctx context.Context, id string) (Proxy, error) + func (s *Service) PushMeta(ctx context.Context, m MetaPusher, force bool) (pushed, failed int, err error) + func (s *Service) Pushes(ctx context.Context, kind string) (map[string]Push, error) + func (s *Service) RecordPush(ctx context.Context, kind, target, plugin, hash string, pushErr error) error + func (s *Service) ReplaceProfile(ctx context.Context, id string, p Profile) (Profile, error) + func (s *Service) Resolver(ctx context.Context) (*Resolver, error) + func (s *Service) SetChanged(fn func(ctx context.Context)) + func (s *Service) Solver(ctx context.Context, id string) (Solver, error) + func (s *Service) Solvers(ctx context.Context, owner *Owner, withCustom bool) ([]Solver, error) + func (s *Service) SourceProfile(ctx context.Context, id string, withSolver bool) (*sourcev1.NetworkProfile, error) + func (s *Service) TestProxy(ctx context.Context, in ProxyInput, target string) (TestResult, error) + func (s *Service) TestSolver(ctx context.Context, in Solver) (TestResult, error) + func (s *Service) Touch(ctx context.Context) + func (s *Service) Unassign(ctx context.Context, kind, id string) error + func (s *Service) UpdateProxy(ctx context.Context, id string, p ProxyPatch) (Proxy, error) + func (s *Service) UpdateSolver(ctx context.Context, id string, p SolverPatch) (Solver, error) + type Solver struct + AsResponseFallback bool + CreatedAt time.Time + ID string + MaxTimeout time.Duration + Name string + Owner *Owner + SessionTTL time.Duration + Type string + URL string + UpdatedAt time.Time + type SolverPatch struct + AsResponseFallback *bool + MaxTimeout *time.Duration + Name *string + SessionTTL *time.Duration + Type *string + URL *string + type TestResult struct + Latency time.Duration + Message string + OK bool + Version string + type Timeouts struct + Call time.Duration + Connect time.Duration + Read time.Duration