Versions in this module Expand all Collapse all v5 v5.0.1 Jul 28, 2026 Changes in this version + const CacheBootstrapDataKey + var ErrCircuitOpen = errors.New("fetch: circuit breaker is open") + func BuildFetchService() pluginruntime.FetchService + func ConfigurePersistentCache(parseOptions PersistentCacheOptions) + func DisposeQueryTag(parseTag string) int + func DisposeResource(parseKey string) + func ExecuteWithPolicy[T any](parseCtx context.Context, parsePolicy ResiliencePolicy, ...) (T, error) + func Fetch(parseUrl string, parseOptions Options) <-chan Result + func InvalidateQueryTag(parseTag string) int + func InvalidateQueryTags(parseTags ...string) int + func InvalidateResource(parseKey string) + func IsMutationConflict(parseErr error) bool + func LoadCached[T any](parseCtx context.Context, parseKey string, ...) (T, error) + func LoadQuery[T any](parseCtx context.Context, parseKey string, ...) (T, error) + func NewMutationConflict(parseErr error, parseConflict MutationConflict) error + func QueryKeysForTag(parseTag string) []string + func QueryTagsForKey(parseKey string) []string + func RestoreCacheBootstrap(parsePayload ui.SSRBootstrap) error + func ReturnChannel(parseCh <-chan Result) + func ScopeCacheKey(parseSegments ...string) string + func SweepCachedResources() int + func Upload(parseCtx context.Context, parseUrl string, parseOptions Options) <-chan UploadUpdate + type AsyncResource struct + func UseResource[T any](parseLoader func(context.Context) (T, error), parseDeps ...any) AsyncResource[T] + func (parseR AsyncResource[T]) Cancel() + func (parseR AsyncResource[T]) Get() ResourceState[T] + func (parseR AsyncResource[T]) Reload() + type BreakerConfig struct + FailureThreshold int + HalfOpenMaxCalls int + OpenDuration time.Duration + type BreakerState int + const StateClosed + const StateHalfOpen + const StateOpen + func (parseState BreakerState) String() string + type CacheBootstrap struct + Entries []CacheBootstrapEntry + type CacheBootstrapEntry struct + Key string + ResumePolicy CacheResumePolicy + StaleAfter time.Duration + UpdatedAt time.Time + Value any + type CacheOptions struct + DisposeAfter time.Duration + MaxAge time.Duration + Persist bool + StaleAfter time.Duration + type CacheResumePolicy string + const CacheResumeAlwaysRefetch + const CacheResumeStaleWhileRevalidate + const CacheResumeTrustOnce + type CachedResource struct + func UseCachedResource[T any](parseKey string, parseLoader func(context.Context) (T, error), ...) CachedResource[T] + func (parseR CachedResource[T]) Cancel() + func (parseR CachedResource[T]) Dispose() + func (parseR CachedResource[T]) Get() CachedResourceState[T] + func (parseR CachedResource[T]) Invalidate() + func (parseR CachedResource[T]) OptimisticUpdate(parseFn func(T) T) OptimisticUpdate[T] + func (parseR CachedResource[T]) Reload() + func (parseR CachedResource[T]) Set(parseValue T) + func (parseR CachedResource[T]) Update(parseFn func(T) T) + type CachedResourceInspection struct + Key string + LastError string + LastLoaded time.Time + Loading bool + OwnerPaths []string + Ready bool + ResumePolicy CacheResumePolicy + Stale bool + SubscriberCount int + Tags []string + UpdatedAt time.Time + func InspectCachedResources() []CachedResourceInspection + type CachedResourceState struct + Error error + Loading bool + Ready bool + Stale bool + UpdatedAt time.Time + Value T + type CircuitBreaker struct + func NewCircuitBreaker(parseConfig BreakerConfig) *CircuitBreaker + func (parseB *CircuitBreaker) State() BreakerState + type DurableMutationRunner func(parseOptimistic T, parseDraft MutationDraft, ...) (QueuedMutation, error) + func UseDurableMutation[T any](parseCache *query.Cache, parseKey string, parseQueue MutationQueue) DurableMutationRunner[T] + type EventSource struct + func UseEventSource(parseURL string, parseOptions ...EventSourceOptions) EventSource + func (parseE EventSource) Close() + func (parseE EventSource) Get() RealtimeState + func (parseE EventSource) Open() + type EventSourceOptions struct + BackoffFactor float64 + DisableReconnect bool + HeartbeatInterval time.Duration + HeartbeatTimeout time.Duration + InitialBackoff time.Duration + Manual bool + MaxBackoff time.Duration + MaxErrors int + MaxMessages int + MaxReconnects int + Now func() time.Time + WithCredentials bool + type HTTPError struct + Body string + Headers map[string]string + Status int + StatusText string + func (parseE HTTPError) Error() string + type InfiniteQuery struct + func UseInfiniteQuery[T any, C any](parseKey string, ...) InfiniteQuery[T, C] + func (parseQ InfiniteQuery[T, C]) CacheKey() string + func (parseQ InfiniteQuery[T, C]) Cancel() + func (parseQ InfiniteQuery[T, C]) Dispose() + func (parseQ InfiniteQuery[T, C]) Get() InfiniteQueryState[T, C] + func (parseQ InfiniteQuery[T, C]) Invalidate() + func (parseQ InfiniteQuery[T, C]) LoadNext() + func (parseQ InfiniteQuery[T, C]) OptimisticUpdate(parseFn func(InfiniteQueryData[T, C]) InfiniteQueryData[T, C]) OptimisticUpdate[InfiniteQueryData[T, C]] + func (parseQ InfiniteQuery[T, C]) Reload() + func (parseQ InfiniteQuery[T, C]) Set(parseValue InfiniteQueryData[T, C]) + func (parseQ InfiniteQuery[T, C]) Tags() []string + func (parseQ InfiniteQuery[T, C]) Update(parseFn func(InfiniteQueryData[T, C]) InfiniteQueryData[T, C]) + type InfiniteQueryData struct + HasNext bool + Items []T + NextCursor C + Pages []QueryPage[T, C] + type InfiniteQueryOptions struct + Cache CacheOptions + InitialCursor C + Tags []string + type InfiniteQueryState struct + Error error + Loading bool + Ready bool + Stale bool + UpdatedAt time.Time + type MultipartBody struct + Fields map[string]string + Files []MultipartFile + type MultipartFile struct + FieldName string + File ui.File + Filename string + type MutationConflict struct + Code string + Fields map[string]string + LocalVersion string + Message string + RemoteVersion string + func GetMutationConflict(parseErr error) (MutationConflict, bool) + type MutationConflictError struct + Conflict MutationConflict + Err error + func AsMutationConflictError(parseErr error) (*MutationConflictError, bool) + func (parseE *MutationConflictError) Error() string + func (parseE *MutationConflictError) Unwrap() error + type MutationConflictHandler func(context.Context, QueuedMutation, MutationConflict) (MutationConflictResolution, error) + type MutationConflictResolution struct + Action MutationResolutionAction + Draft MutationDraft + Message string + type MutationDraft struct + Body any + DedupKey string + Headers map[string]string + ID string + Kind string + Metadata map[string]string + Method string + URL string + type MutationExecutor func(context.Context, QueuedMutation) error + type MutationQueue struct + func OpenMutationQueue(parseOptions ...MutationQueueOptions) (MutationQueue, error) + func (parseQ MutationQueue) Clear() error + func (parseQ MutationQueue) Enqueue(parseDraft MutationDraft) (QueuedMutation, error) + func (parseQ MutationQueue) List() ([]QueuedMutation, error) + func (parseQ MutationQueue) Remove(parseId string) error + func (parseQ MutationQueue) Replay(parseCtx context.Context, parseExecutor MutationExecutor) (MutationReplayReport, error) + func (parseQ MutationQueue) ReplayWithOptions(parseCtx context.Context, parseExecutor MutationExecutor, ...) (MutationReplayReport, error) + type MutationQueueOptions struct + BaseDelay time.Duration + DeleteOnCorruption bool + MaxAttempts int + MaxDelay time.Duration + Now func() time.Time + StorageKey string + StorageResolver func() (interop.Storage, error) + StoreResolver func(context.Context) (interop.PersistentStore, error) + type MutationReplayOptions struct + ConflictHandler MutationConflictHandler + type MutationReplayReport struct + Conflicts int + DeadLetters int + Deferred int + Remaining int + Resolved int + Retried int + Succeeded int + type MutationResolutionAction string + const MutationResolutionDead + const MutationResolutionRemove + const MutationResolutionReplace + const MutationResolutionRetry + type MutationState string + const MutationDead + const MutationQueued + const MutationRetrying + type OptimisticUpdate struct + func ApplyOptimisticUpdate[T any](parseKey string, parseFn func(T) T) OptimisticUpdate[T] + func (parseU *OptimisticUpdate[T]) Commit() + func (parseU *OptimisticUpdate[T]) Rollback() + func (parseU OptimisticUpdate[T]) Active() bool + type Options struct + Body any + Headers map[string]any + Method string + type PersistentCacheOptions struct + DatabaseName string + FallbackBackend string + FallbackResolver func() (interop.Storage, error) + StoreName string + StoreResolver func(context.Context) (interop.PersistentStore, error) + type Query struct + func UseQuery[T any](parseKey string, parseLoader func(context.Context) (T, error), ...) Query[T] + func (parseQ Query[T]) CacheKey() string + func (parseQ Query[T]) Cancel() + func (parseQ Query[T]) Dispose() + func (parseQ Query[T]) Get() CachedResourceState[T] + func (parseQ Query[T]) Invalidate() + func (parseQ Query[T]) OptimisticUpdate(parseFn func(T) T) OptimisticUpdate[T] + func (parseQ Query[T]) Reload() + func (parseQ Query[T]) Set(parseValue T) + func (parseQ Query[T]) Tags() []string + func (parseQ Query[T]) Update(parseFn func(T) T) + type QueryOptions struct + Cache CacheOptions + Tags []string + type QueryPage struct + HasNext bool + Items []T + NextCursor C + type QueryPageRequest struct + Cursor C + PageIndex int + type QueuedMutation struct + Attempts int + Body any + CreatedAt time.Time + DedupKey string + Headers map[string]string + ID string + Kind string + LastError string + MaxAttempts int + Metadata map[string]string + Method string + NextAttemptAt time.Time + State MutationState + URL string + UpdatedAt time.Time + type RealtimeError struct + At time.Time + Message string + type RealtimeMessage struct + Data string + LastEventID string + ReceivedAt time.Time + Type string + type RealtimeState struct + Closed bool + ConnectAttempts int + Connecting bool + Error error + Errors []RealtimeError + HeartbeatMisses int + LastCloseAt time.Time + LastHeartbeatAt time.Time + LastMessage RealtimeMessage + LastOpenAt time.Time + Messages []RealtimeMessage + NextReconnectAt time.Time + Open bool + ReconnectAttempts int + Reconnects int + Status RealtimeStatus + Supported bool + type RealtimeStatus string + const RealtimeClosed + const RealtimeConnecting + const RealtimeIdle + const RealtimeOpen + const RealtimeReconnecting + const RealtimeUnsupported + type ResiliencePolicy struct + Breaker *CircuitBreaker + Retry RetryPolicy + func NewResiliencePolicy(parseRetry RetryPolicy, parseBreaker *CircuitBreaker) ResiliencePolicy + type Resource struct + func UseFetch(parseUrl string, parseOptions ...Options) Resource + func (parseR Resource) Get() State + func (parseR Resource) Refetch() + type ResourceState struct + Error error + Loading bool + Ready bool + Value T + type Result struct + Data any + Err error + Headers map[string]string + Status int + func (parseR Result) DecodeJSON(parseTarget any) error + func (parseR Result) Text() string + type RetryPolicy struct + BaseDelay time.Duration + Jitter float64 + MaxAttempts int + MaxDelay time.Duration + Multiplier float64 + RetryIf func(error) bool + func DefaultRetryPolicy() RetryPolicy + type State = runtime.FetchState + type UploadUpdate struct + Done bool + LengthComputable bool + Loaded int64 + Result Result + Total int64 + type WebSocket struct + func UseWebSocket(parseURL string, parseOptions ...WebSocketOptions) WebSocket + func (parseW WebSocket) Close() + func (parseW WebSocket) Get() RealtimeState + func (parseW WebSocket) Open() + func (parseW WebSocket) Send(parseMessage string) error + type WebSocketOptions struct + BackoffFactor float64 + DisableReconnect bool + HeartbeatInterval time.Duration + HeartbeatMessage string + HeartbeatTimeout time.Duration + InitialBackoff time.Duration + Manual bool + MaxBackoff time.Duration + MaxErrors int + MaxMessages int + MaxReconnects int + Now func() time.Time + Protocols []string Other modules containing this package github.com/monstercameron/GoWebComponents github.com/monstercameron/GoWebComponents/v4