Versions in this module Expand all Collapse all v0 v0.1.0 Oct 30, 2026 Changes in this version + const DefaultLimit + var ErrClientUninitialized = errors.New("web API client is nil or uninitialized") + var ErrConfigureClient = errors.New("configure Web API client") + var ErrConflictingQueryFilter = errors.New("conflicting server filter predicates") + var ErrCreateRequest = errors.New("create Web API request") + var ErrDecodeResponse = errors.New("decode Web API response") + var ErrDecodeServerList = errors.New("decode Web API servers") + var ErrDecodeServerRecord = errors.New("decode Web API server") + var ErrDiscoveryResponseOverLimit = errors.New("discovery response exceeds requested row limit") + var ErrExecuteRequest = errors.New("execute Web API request") + var ErrFilterCannotCombineNORAndNAND = errors.New("filter cannot combine NOR and NAND conditions") + var ErrInvalidAPIErrorCode = errors.New("invalid API error code") + var ErrInvalidAPIKey = errors.New("invalid API key") + var ErrInvalidBaseURL = errors.New("invalid Web API base URL") + var ErrInvalidDiscoveryOptions = errors.New("invalid discovery options") + var ErrInvalidDiscoveryPlan = errors.New("invalid discovery plan") + var ErrInvalidJSONBoolean = errors.New("invalid JSON boolean value") + var ErrInvalidListLimit = errors.New("invalid limit") + var ErrInvalidQueryFilter = errors.New("invalid validated server filter") + var ErrInvalidServerAddress = errors.New("invalid server address") + var ErrInvalidSteamID = errors.New("invalid steamid") + var ErrListLimitExceedsMaximum = errors.New("limit exceeds maximum") + var ErrMaxResponseSizeMustBePositive = errors.New("maximum response size must be positive") + var ErrMaxResponseSizeOverflows = errors.New("maximum response size is too large") + var ErrMethodNotAllowed = errors.New("method not allowed") + var ErrMissingResponseEnvelope = errors.New("web API response envelope is missing response") + var ErrNilContext = errors.New("web API context is nil") + var ErrNilHTTPClient = errors.New("HTTP client is nil") + var ErrNilProvider = errors.New("provider is not configured") + var ErrProviderFailure = errors.New("provider error") + var ErrReadResponseBody = errors.New("read Web API response") + var ErrResponseTooLarge = errors.New("web API response exceeds configured size limit") + var ErrUnsupportedBaseURLScheme = errors.New("unsupported Web API base URL scheme") + var ErrUnsupportedDiscoveryFilter = errors.New("unsupported discovery filter expression") + func NewHandler(provider Provider, opts ...HandlerOption) http.Handler + type APIError struct + Code string + Description string + func (e *APIError) Error() string + func (e *APIError) UnmarshalJSON(data []byte) error + type Client struct + func New(apiKey string, opts ...Option) (*Client, error) + func (c *Client) Collect(ctx context.Context, plan DiscoveryPlan, options CollectOptions) (Result[Server], error) + func (c *Client) CollectAddresses(ctx context.Context, plan DiscoveryPlan, options CollectOptions) (Result[netip.AddrPort], error) + func (c *Client) CollectLite(ctx context.Context, plan DiscoveryPlan, options CollectOptions) (Result[ServerLite], error) + func (c *Client) Discover(ctx context.Context, root QueryFilter, options DiscoveryOptions) (DiscoveryResult[Server], error) + func (c *Client) DiscoverAddresses(ctx context.Context, root QueryFilter, options DiscoveryOptions) (DiscoveryResult[netip.AddrPort], error) + func (c *Client) DiscoverLite(ctx context.Context, root QueryFilter, options DiscoveryOptions) (DiscoveryResult[ServerLite], error) + func (c *Client) List(ctx context.Context, query ListQuery) (Servers, error) + func (c *Client) ListAddresses(ctx context.Context, query ListQuery) ([]netip.AddrPort, error) + func (c *Client) ListLite(ctx context.Context, query ListQuery) ([]ServerLite, error) + type CollectOptions struct + Diagnostics func(DiscoveryEvent) + MaxRequests int + type DiscoveryEvent struct + ActiveLeaves int + BufferedRecords int + DurationMS int64 + Error string + Filter string + Mismatches []DiscoveryMismatch + NewEndpoints int + Reason DiscoveryReasons + Request int + ReturnedRows int + type DiscoveryMismatch struct + Address netip.AddrPort + Key FilterKey + Matched bool + Value string + type DiscoveryOptions struct + Diagnostics func(DiscoveryEvent) + Features []SplitFeature + Limit uint32 + MaxBufferedRecords int + MaxDepth int + MaxPlanQueries int + MaxRequests int + MinValueCount int + type DiscoveryPlan struct + func (plan *DiscoveryPlan) UnmarshalJSON(data []byte) error + func (plan DiscoveryPlan) MarshalJSON() ([]byte, error) + func (plan DiscoveryPlan) Queries() []ListQuery + func (plan DiscoveryPlan) QueryCount() int + func (plan DiscoveryPlan) Validate() error + type DiscoveryReasons uint16 + const DiscoveryReasonBufferBudget + const DiscoveryReasonDepthLimit + const DiscoveryReasonInconsistent + const DiscoveryReasonNoUsefulSplit + const DiscoveryReasonPlanQueryBudget + const DiscoveryReasonRequestBudget + const DiscoveryReasonRequestFailure + const DiscoveryReasonSaturated + const DiscoveryReasonUnverifiedSemantics + func (reasons DiscoveryReasons) Has(reason DiscoveryReasons) bool + type DiscoveryResult struct + Plan DiscoveryPlan + type DiscoveryStatus struct + Reasons DiscoveryReasons + Requests int + Unresolved int + func (status DiscoveryStatus) Complete() bool + type Filter struct + func NewFilter() *Filter + func (f *Filter) Add(key FilterKey, value string) + func (f *Filter) AddNand(key FilterKey, value string) + func (f *Filter) AddNor(key FilterKey, value string) + func (f *Filter) Clone() *Filter + func (f *Filter) Remove(key FilterKey, value string) + func (f *Filter) RemoveNand(key FilterKey, value string) + func (f *Filter) RemoveNor(key FilterKey, value string) + func (f *Filter) String() (string, error) + type FilterKey string + const KeyAppID + const KeyDedicated + const KeyEmpty + const KeyFull + const KeyGameAddr + const KeyGameData + const KeyGameDir + const KeyGameType + const KeyLinux + const KeyMap + const KeyName + const KeyNoPlayers + const KeyNotAppID + const KeyNotFull + const KeyPassword + const KeyProxy + const KeySecure + const KeySingleAddr + const KeyVersion + const KeyWhite + type GroupKind string + const GroupNAND + const GroupNOR + const GroupOR + type HTTPError struct + Status string + StatusCode int + func (e *HTTPError) Error() string + type HandlerOption func(*handlerConfig) + func WithMaxLimit(limit uint32) HandlerOption + func WithRequiredKey(key string) HandlerOption + type ListQuery struct + Filter string + Limit uint32 + type Option func(*clientConfig) error + func WithBaseURL(rawURL string) Option + func WithHTTPClient(client *http.Client) Option + func WithMaxResponseSize(size int64) Option + type Predicate struct + Key FilterKey + Value string + type PredicateGroup struct + Kind GroupKind + Predicates []Predicate + type Provider interface + List func(ctx context.Context, query ListQuery) ([]Server, error) + type ProviderFunc func(ctx context.Context, query ListQuery) ([]Server, error) + func (f ProviderFunc) List(ctx context.Context, query ListQuery) ([]Server, error) + type QueryFilter struct + func NewQueryFilter(all []Predicate, group *PredicateGroup) (QueryFilter, error) + func (q QueryFilter) String() string + type Result struct + Items []T + Status DiscoveryStatus + type Server struct + Addr netip.AddrPort + AppID uint32 + Bots int32 + Dedicated bool + GameDir string + GamePort uint16 + GameType []string + Map string + MaxPlayers int32 + Name string + OS string + Players int32 + Product string + Region int32 + Secure bool + SpectatorPort uint16 + SteamID uint64 + Version string + type ServerLite struct + Addr netip.AddrPort + Dedicated bool + GameType []string + Map string + MaxPlayers int32 + OS string + Players int32 + Secure bool + Version string + type Servers []Server + func (servers Servers) GetVersionMap() map[string]uint32 + type SplitFeature struct + Key FilterKey + Weight float64 + func DefaultSplitFeatures() []SplitFeature