Versions in this module Expand all Collapse all v0 v0.1.0 Nov 10, 2026 Changes in this version + var ErrConflict = errors.New("contribution_conflict") + var ErrDenied = errors.New("contribution_permission_denied") + var ErrInput = errors.New("contribution_invalid_input") + var ErrNotFound = errors.New("contribution_not_found") + var ErrUnavailable = errors.New("contribution_unavailable") + func OwnerDomain(p Principal) string + type Access struct + ID string + Owner Principal + type Authorizer interface + Authorize func(context.Context, Principal, string, Access) error + type CommandRequest struct + Action string + Conditions *Conditions + Consent *Consent + Revision int64 + type Conditions struct + LimitBytes int64 + PersonalReserve int64 + Until time.Time + type Config struct + Actor Principal + Clock func() time.Time + Lease time.Duration + MaxAttempts int + MaxContributions int + OperationTimeout time.Duration + Policy Policy + RefreshInterval time.Duration + type Consent struct + Accepted bool + Digest string + Version string + type CreateRequest struct + Conditions Conditions + Consent Consent + InstanceID string + type Event struct + Actor Principal + Data EventData + DataContentType string + ID string + Source string + SpecVersion string + Subject string + Time time.Time + Type string + type EventData struct + AppliedRevision int64 + DesiredRevision int64 + Revision int64 + State string + type Job struct + Attempts int + AvailableAt time.Time + Generation int64 + ID string + LeaseOwner string + LeaseUntil time.Time + State string + type Observation struct + AuthorizationExpiresAt time.Time + Authorized bool + AvailableBytes int64 + ObservedAt time.Time + QuotaExpiresAt time.Time + RemainingReplicas int64 + ReservedBytes int64 + UsedBytes int64 + type Page struct + Items []View + NextCursor string + type Policy struct + Adapters []string + ExitTargetSeconds int64 + MaxBytes int64 + MaxPerOwner int + MaxTermSeconds int64 + MinBytes int64 + MinTermSeconds int64 + ObservationMaxAgeSeconds int64 + Terms Terms + type Principal = storage.Principal + type Record struct + EventRevision int64 + InstanceID string + Owner Principal + View View + type Replay struct + ExpiresAt time.Time + Hash string + Key string + Result View + type Repository interface + AcknowledgeEvent func(context.Context, string) error + Claim func(context.Context, string, time.Time, time.Duration) (Job, error) + PendingEvents func(context.Context, int) ([]Event, error) + Transaction func(context.Context, func(Transaction) error) error + type RetryRequest struct + Revision int64 + type Service struct + func New(r Repository, a Authorizer, st Store, c Config) (*Service, error) + func (s *Service) Command(ctx context.Context, p Principal, id, key string, q CommandRequest) (View, error) + func (s *Service) Create(ctx context.Context, p Principal, key string, q CreateRequest) (View, error) + func (s *Service) Get(ctx context.Context, p Principal, id string) (View, error) + func (s *Service) List(ctx context.Context, p Principal, n int, after string) (Page, error) + func (s *Service) Operations(ctx context.Context, p Principal, n int, after string) (Page, error) + func (s *Service) Options(ctx context.Context, p Principal, n int, after string) (storage.ContributionCandidates, error) + func (s *Service) Policy() Policy + func (s *Service) RetryOperation(ctx context.Context, p Principal, id, key string, q RetryRequest) (View, error) + func (s *Service) RunOne(ctx context.Context, worker string) error + func (s *Service) Statistics(ctx context.Context) (Statistics, error) + func (s *Service) Sweep(ctx context.Context, n int, after string) (string, error) + type Statistics struct + AvailableBytes int64 + Contributions int + DeclaredBytes int64 + FreshObservations int + GeneratedAt time.Time + ReservedBytes int64 + Status string + UsedBytes int64 + type Store interface + ApplyContribution func(context.Context, Principal, string, storage.ContributionControl) (storage.ContributionSnapshot, error) + InspectContribution func(context.Context, Principal, string, string) (storage.ContributionSnapshot, error) + ListContributionCandidates func(context.Context, Principal, string, int, string) (storage.ContributionCandidates, error) + type Terms struct + Digest string + URL string + Version string + type Transaction interface + Counts func(Principal) (total, owned int, err error) + Event func(Event) error + Job func(string) (Job, error) + List func(Principal, int, string) ([]Record, error) + Lock func(string) error + PruneReplays func(time.Time, int) error + Record func(string) (Record, error) + Replay func(string) (Replay, error) + SaveJob func(Job) error + SaveRecord func(Record) error + SaveReplay func(Replay) error + Scan func(int, string) ([]Record, error) + type View struct + AcceptedAt time.Time + Adapter string + AppliedRevision int64 + Conditions Conditions + Consent Terms + CreatedAt time.Time + DesiredState string + ExitRequestedAt *time.Time + ExitTargetAt *time.Time + ID string + Observation *Observation + Reason string + Revision int64 + State string + UpdatedAt time.Time