datasource

package
v0.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package datasource owns storage-neutral profile and administrative-policy contracts without binding protocol code to provider models.

Requests select exact validated identities and uses. Successful results are immutable, self-contained, and generation-consistent; absence, ambiguity, inactive data, malformed input, provider unavailability, cancellation, and invariants remain distinct closed failures. Credentials contain public verification material and provider-neutral key-handle IDs, never private keys, signing callbacks, paths, or provider-specific backend records.

Replay storage is a separate domain. Concrete providers and the signing bridge live in subpackages so protocol owners do not import provider implementations.

Index

Constants

View Source
const (
	// AlgorithmRSASHA256 identifies one RSA-SHA256 signing credential.
	AlgorithmRSASHA256 = signature.AlgorithmRSASHA256
	// AlgorithmEd25519SHA256 identifies one Ed25519-SHA256 signing credential.
	AlgorithmEd25519SHA256 = signature.AlgorithmEd25519SHA256
	// AlgorithmMLDSA44 identifies one pure ML-DSA-44 signing credential.
	AlgorithmMLDSA44 = signature.AlgorithmMLDSA44
)

Variables

This section is empty.

Functions

func ErrorFromContext

func ErrorFromContext(ctx context.Context) (result error)

ErrorFromContext maps a context state into the closed error taxonomy.

func IsTypedError

func IsTypedError(err error) bool

IsTypedError reports whether an error belongs to the closed datasource taxonomy.

func NewError

func NewError(code ErrorCode) error

NewError constructs one stable datasource failure without protected detail.

func ProfileFactsEqual

func ProfileFactsEqual(left, right Profile) bool

ProfileFactsEqual reports exact equality for two immutable profile values.

func ReconcileContextFailure

func ReconcileContextFailure(boundaryErr, contextErr error) error

ReconcileContextFailure combines one validated boundary failure with the context state observed after that boundary. Internal or contradictory outcomes fail closed; coherent terminal context controls ordinary outcomes.

func ValidatePolicyOutcome

func ValidatePolicyOutcome(result ResolvedPolicy, err error) error

ValidatePolicyOutcome enforces the closed policy result/error matrix.

func ValidateProfileOutcome

func ValidateProfileOutcome(result ResolvedProfile, err error) error

ValidateProfileOutcome enforces the closed profile result/error matrix.

Types

type Algorithm

type Algorithm = signature.Algorithm

Algorithm aliases the signature owner's closed signing algorithm vocabulary.

type Compatibility

type Compatibility uint8

Compatibility identifies one closed compatibility policy.

const (
	// CompatibilityStrict preserves every restrictive DKIM2 rule.
	CompatibilityStrict Compatibility = iota + 1
)

func ParseCompatibility

func ParseCompatibility(value string) (Compatibility, error)

ParseCompatibility parses the one supported compatibility value.

func (Compatibility) Format

func (c Compatibility) Format(state fmt.State, _ rune)

Format prevents formatting verbs from exposing unknown numeric values.

func (Compatibility) GoString

func (c Compatibility) GoString() string

GoString returns the stable compatibility representation.

func (Compatibility) Known

func (c Compatibility) Known() bool

Known reports whether the compatibility value is supported.

func (Compatibility) MarshalJSON

func (c Compatibility) MarshalJSON() ([]byte, error)

MarshalJSON emits only a known closed compatibility value.

func (Compatibility) String

func (c Compatibility) String() string

String returns the stable compatibility value or a constant unknown marker.

type Credential

type Credential struct {
	// contains filtered or unexported fields
}

Credential contains one immutable public signing credential and opaque handle ID.

func NewCredential

func NewCredential(selector string, algorithm Algorithm, publicKeySPKI []byte, handleID KeyHandleID, limits Limits) (Credential, error)

NewCredential validates and detaches one provider-neutral signing credential.

func (Credential) Algorithm

func (c Credential) Algorithm() Algorithm

Algorithm returns the baseline signing algorithm.

func (Credential) Format

func (c Credential) Format(state fmt.State, _ rune)

Format prevents formatting verbs from exposing credential facts.

func (Credential) GoString

func (c Credential) GoString() string

GoString returns a constant protected credential representation.

func (Credential) KeyHandleID

func (c Credential) KeyHandleID() KeyHandleID

KeyHandleID returns the provider-neutral opaque handle identifier.

func (Credential) PublicKey

func (c Credential) PublicKey() any

PublicKey returns detached validated public-key material.

func (Credential) PublicKeySPKIDER

func (c Credential) PublicKeySPKIDER() []byte

PublicKeySPKIDER returns detached canonical public SPKI DER.

func (Credential) PublicKeySPKISHA256

func (c Credential) PublicKeySPKISHA256() [sha256.Size]byte

PublicKeySPKISHA256 returns the digest of the exact canonical SPKI DER.

func (Credential) Selector

func (c Credential) Selector() string

Selector returns the canonical selector.

func (Credential) String

func (c Credential) String() string

String returns a constant protected credential summary.

func (Credential) Valid

func (c Credential) Valid() bool

Valid reports whether the credential remains complete under hard limits.

func (Credential) ValidForLimits

func (c Credential) ValidForLimits(limits Limits) bool

ValidForLimits reports whether the credential satisfies one narrowed datasource contract.

type Error

type Error struct {
	// contains filtered or unexported fields
}

Error is one typed secret-safe datasource failure.

func (*Error) Code

func (e *Error) Code() ErrorCode

Code returns the stable failure code.

func (*Error) Error

func (e *Error) Error() string

Error returns only the stable failure class.

func (*Error) Format

func (e *Error) Format(state fmt.State, _ rune)

Format prevents formatting verbs from exposing internal cause representation.

func (*Error) GoString

func (e *Error) GoString() string

GoString returns only the stable failure class.

func (*Error) Unwrap

func (e *Error) Unwrap() error

Unwrap preserves only standard context cancellation identity.

type ErrorCode

type ErrorCode string

ErrorCode is one stable datasource failure class.

const (
	// ErrorCodeInvalidRequest classifies an invalid request or zero value.
	ErrorCodeInvalidRequest ErrorCode = "invalid_request"
	// ErrorCodeNotFound classifies an absent exact record or binding.
	ErrorCodeNotFound ErrorCode = "not_found"
	// ErrorCodeAmbiguous classifies duplicate exact records.
	ErrorCodeAmbiguous ErrorCode = "ambiguous"
	// ErrorCodeInactive classifies a closed administrative record.
	ErrorCodeInactive ErrorCode = "inactive"
	// ErrorCodeMalformedData classifies invalid provider input.
	ErrorCodeMalformedData ErrorCode = "malformed_data"
	// ErrorCodeLimitExceeded classifies an exceeded resource bound.
	ErrorCodeLimitExceeded ErrorCode = "limit_exceeded"
	// ErrorCodeUnavailable classifies a provider that cannot safely serve.
	ErrorCodeUnavailable ErrorCode = "unavailable"
	// ErrorCodeUnsupportedPlatform classifies missing confinement primitives.
	ErrorCodeUnsupportedPlatform ErrorCode = "unsupported_platform"
	// ErrorCodeCancelled classifies context cancellation.
	ErrorCodeCancelled ErrorCode = "cancelled"
	// ErrorCodeDeadlineExceeded classifies an elapsed context deadline.
	ErrorCodeDeadlineExceeded ErrorCode = "deadline_exceeded"
	// ErrorCodeInternalInvariant classifies an impossible internal state.
	ErrorCodeInternalInvariant ErrorCode = "internal_invariant"
)

func ErrorCodeOf

func ErrorCodeOf(err error) ErrorCode

ErrorCodeOf returns the stable code for one datasource failure.

func (ErrorCode) Known

func (c ErrorCode) Known() bool

Known reports whether the code belongs to the closed taxonomy.

type FeedbackRouteID

type FeedbackRouteID struct {
	// contains filtered or unexported fields
}

FeedbackRouteID identifies one opaque later-service feedback route.

func NewFeedbackRouteID

func NewFeedbackRouteID(value string) (FeedbackRouteID, error)

NewFeedbackRouteID validates one canonical feedback-route identifier.

func (FeedbackRouteID) ByteLen

func (i FeedbackRouteID) ByteLen() int

ByteLen returns the canonical identifier byte length.

func (FeedbackRouteID) Format

func (i FeedbackRouteID) Format(state fmt.State, _ rune)

Format prevents formatting verbs from exposing the identifier.

func (FeedbackRouteID) GoString

func (i FeedbackRouteID) GoString() string

GoString returns a constant protected feedback-route representation.

func (FeedbackRouteID) String

func (i FeedbackRouteID) String() string

String returns a constant protected feedback-route summary.

func (FeedbackRouteID) Valid

func (i FeedbackRouteID) Valid() bool

Valid reports whether the feedback-route identifier is initialized.

func (FeedbackRouteID) WithinMaxBytes

func (i FeedbackRouteID) WithinMaxBytes(maximum int) bool

WithinMaxBytes reports whether the identifier fits a valid narrowed bound.

type InspectionProvider

type InspectionProvider interface {
	Provider
	InspectPolicy(context.Context, PolicyRequest) (ResolvedPolicy, error)
}

InspectionProvider exposes exact immutable policy facts for registry construction, including inactive records. Inspection never authorizes signing; callers must use Provider and the signing projection at message time.

type KeyHandleID

type KeyHandleID struct {
	// contains filtered or unexported fields
}

KeyHandleID identifies one provider-neutral private-key handle binding.

func NewKeyHandleID

func NewKeyHandleID(value string) (KeyHandleID, error)

NewKeyHandleID validates one canonical key-handle identifier.

func (KeyHandleID) ByteLen

func (i KeyHandleID) ByteLen() int

ByteLen returns the canonical identifier byte length.

func (KeyHandleID) Format

func (i KeyHandleID) Format(state fmt.State, _ rune)

Format prevents formatting verbs from exposing the identifier.

func (KeyHandleID) GoString

func (i KeyHandleID) GoString() string

GoString returns a constant protected key-handle representation.

func (KeyHandleID) String

func (i KeyHandleID) String() string

String returns a constant protected key-handle summary.

func (KeyHandleID) Valid

func (i KeyHandleID) Valid() bool

Valid reports whether the key-handle identifier is initialized.

func (KeyHandleID) WithinMaxBytes

func (i KeyHandleID) WithinMaxBytes(maximum int) bool

WithinMaxBytes reports whether the identifier fits a valid narrowed bound.

type Limits

type Limits struct {
	MaxIdentifierBytes       int
	MaxDomainBytes           int
	MaxDomainLabels          int
	MaxSelectorBytes         int
	MaxSelectorLabels        int
	MaxProfiles              int
	MaxCredentialsPerProfile int
	MaxHandles               int
	MaxPolicies              int
	MaxJSONFileBytes         int
	MaxJSONDepth             int
	MaxJSONStringBytes       int
	MaxDecodedStringBytes    int
	MaxDecodedPublicKeyBytes int
	MaxRecords               int
}

Limits bounds every datasource construction and parsing resource.

func DefaultLimits

func DefaultLimits() Limits

DefaultLimits returns the restrictive default datasource limits. Every credential references its own key handle (providers reject a handle shared between credentials), so MaxHandles is derived as MaxProfiles*MaxCredentialsPerProfile and a profile can carry one credential per signable algorithm (rsa-sha256, ed25519-sha256, mldsa44). MaxRecords is derived too: MaxProfiles*MaxCredentialsPerProfile + MaxProfiles + MaxHandles + MaxPolicies:

MaxHandles = 1024*3 = 3072
MaxRecords = 1024*3 + 1024 + 3072 + 4096 = 11264

ProductionLimits follows the same derivation.

func HardLimits

func HardLimits() Limits

HardLimits returns every non-widenable datasource maximum. The ceiling follows the same derivation as DefaultLimits, so a datasource that fills MaxProfiles with MaxCredentialsPerProfile credentials each still fits:

MaxHandles = 131072*3 = 393216
MaxRecords = 131072*3 + 131072 + 393216 + 262144 = 1179648

func ProductionLimits

func ProductionLimits() Limits

ProductionLimits returns the finite large-installation profile:

MaxHandles = 32768*3 = 98304
MaxRecords = 32768*3 + 32768 + 98304 + 65536 = 294912

Both stay within HardLimits (393216 handles, 1179648 records).

func (Limits) Validate

func (l Limits) Validate() error

Validate rejects zero, negative, or widened limits.

type Policy

type Policy struct {
	// contains filtered or unexported fields
}

Policy contains one immutable exact administrative profile binding.

func NewPolicy

func NewPolicy(
	tenant TenantID,
	domain string,
	use ProfileUse,
	profileID ProfileID,
	status RecordStatus,
	rollout Rollout,
	compatibility Compatibility,
	feedback FeedbackRouteID,
	limits Limits,
) (Policy, error)

NewPolicy validates one exact administrative domain and tenant binding.

func (Policy) Compatibility

func (p Policy) Compatibility() Compatibility

Compatibility returns the strict compatibility policy.

func (Policy) Eligible

func (p Policy) Eligible() error

Eligible verifies whether this administrative policy may select a signing profile.

func (Policy) FeedbackRouteID

func (p Policy) FeedbackRouteID() (FeedbackRouteID, bool)

FeedbackRouteID returns the optional opaque feedback-route reference.

func (Policy) Format

func (p Policy) Format(state fmt.State, _ rune)

Format prevents formatting verbs from exposing policy facts.

func (Policy) GoString

func (p Policy) GoString() string

GoString returns a constant protected policy representation.

func (Policy) ProfileID

func (p Policy) ProfileID() ProfileID

ProfileID returns the exact bound profile identity.

func (Policy) Rollout

func (p Policy) Rollout() Rollout

Rollout returns the closed administrative rollout state.

func (Policy) SigningDomain

func (p Policy) SigningDomain() string

SigningDomain returns the canonical administrative signing domain.

func (Policy) Status

func (p Policy) Status() RecordStatus

Status returns the closed policy-record status.

func (Policy) String

func (p Policy) String() string

String returns a constant protected policy summary.

func (Policy) TenantID

func (p Policy) TenantID() TenantID

TenantID returns the exact tenant identity.

func (Policy) Use

func (p Policy) Use() ProfileUse

Use returns the exact administrative selection purpose.

func (Policy) Valid

func (p Policy) Valid() bool

Valid reports whether the policy remains complete under hard limits.

func (Policy) ValidForLimits

func (p Policy) ValidForLimits(limits Limits) bool

ValidForLimits reports whether the policy satisfies one narrowed datasource contract.

type PolicyRequest

type PolicyRequest struct {
	// contains filtered or unexported fields
}

PolicyRequest asks for one exact administrative tenant/domain/use binding.

func NewPolicyRequest

func NewPolicyRequest(tenant TenantID, domain string, use ProfileUse, at time.Time, limits Limits) (PolicyRequest, error)

NewPolicyRequest validates one exact administrative policy request.

func (PolicyRequest) EvaluationTime

func (r PolicyRequest) EvaluationTime() time.Time

EvaluationTime returns the captured UTC evaluation instant.

func (PolicyRequest) Format

func (r PolicyRequest) Format(state fmt.State, _ rune)

Format prevents formatting verbs from exposing request facts.

func (PolicyRequest) GoString

func (r PolicyRequest) GoString() string

GoString returns a constant protected request representation.

func (PolicyRequest) SigningDomain

func (r PolicyRequest) SigningDomain() string

SigningDomain returns the canonical administrative domain.

func (PolicyRequest) String

func (r PolicyRequest) String() string

String returns a constant protected request summary.

func (PolicyRequest) TenantID

func (r PolicyRequest) TenantID() TenantID

TenantID returns the exact requested tenant.

func (PolicyRequest) Use

func (r PolicyRequest) Use() ProfileUse

Use returns the administrative selection purpose.

func (PolicyRequest) Valid

func (r PolicyRequest) Valid() bool

Valid reports whether the policy request is initialized.

func (PolicyRequest) ValidForLimits

func (r PolicyRequest) ValidForLimits(limits Limits) bool

ValidForLimits reports whether the policy request satisfies one narrowed datasource contract.

type Profile

type Profile struct {
	// contains filtered or unexported fields
}

Profile contains one immutable complete datasource signing profile.

func NewProfile

func NewProfile(
	id ProfileID,
	domain string,
	status RecordStatus,
	credentials []Credential,
	notBefore time.Time,
	notAfter time.Time,
	limits Limits,
) (Profile, error)

NewProfile validates and detaches one complete datasource signing profile.

func (Profile) ActiveAt

func (p Profile) ActiveAt(at time.Time) error

ActiveAt verifies status and the optional half-open validity window at one captured instant.

func (Profile) CredentialCount

func (p Profile) CredentialCount() int

CredentialCount returns the bounded number of complete profile credentials.

func (Profile) Credentials

func (p Profile) Credentials() []Credential

Credentials returns detached credentials in canonical signing order: RSA, Ed25519, then ML-DSA-44.

func (Profile) Format

func (p Profile) Format(state fmt.State, _ rune)

Format prevents formatting verbs from exposing profile facts.

func (Profile) GoString

func (p Profile) GoString() string

GoString returns a constant protected profile representation.

func (Profile) ID

func (p Profile) ID() ProfileID

ID returns the exact profile identity.

func (Profile) SigningDomain

func (p Profile) SigningDomain() string

SigningDomain returns the canonical profile signing domain.

func (Profile) Status

func (p Profile) Status() RecordStatus

Status returns the closed administrative profile status.

func (Profile) String

func (p Profile) String() string

String returns a constant protected profile summary.

func (Profile) Valid

func (p Profile) Valid() bool

Valid reports whether the profile remains complete under hard limits.

func (Profile) ValidForLimits

func (p Profile) ValidForLimits(limits Limits) bool

ValidForLimits reports whether the profile satisfies one narrowed datasource contract.

func (Profile) ValidityWindow

func (p Profile) ValidityWindow() (time.Time, time.Time, bool)

ValidityWindow returns the optional half-open UTC validity window.

type ProfileID

type ProfileID struct {
	// contains filtered or unexported fields
}

ProfileID identifies one exact signing profile.

func NewProfileID

func NewProfileID(value string) (ProfileID, error)

NewProfileID validates one canonical profile identifier.

func (ProfileID) ByteLen

func (i ProfileID) ByteLen() int

ByteLen returns the canonical identifier byte length.

func (ProfileID) Format

func (i ProfileID) Format(state fmt.State, _ rune)

Format prevents formatting verbs from exposing the identifier.

func (ProfileID) GoString

func (i ProfileID) GoString() string

GoString returns a constant protected profile-identifier representation.

func (ProfileID) String

func (i ProfileID) String() string

String returns a constant protected profile-identifier summary.

func (ProfileID) Valid

func (i ProfileID) Valid() bool

Valid reports whether the profile identifier is initialized.

func (ProfileID) WithinMaxBytes

func (i ProfileID) WithinMaxBytes(maximum int) bool

WithinMaxBytes reports whether the identifier fits a valid narrowed bound.

type ProfileRequest

type ProfileRequest struct {
	// contains filtered or unexported fields
}

ProfileRequest asks for one exact profile under an administrative use.

func NewProfileRequest

func NewProfileRequest(profileID ProfileID, use ProfileUse, at time.Time, limits Limits) (ProfileRequest, error)

NewProfileRequest validates one exact profile request under narrowed limits.

func (ProfileRequest) EvaluationTime

func (r ProfileRequest) EvaluationTime() time.Time

EvaluationTime returns the captured UTC evaluation instant.

func (ProfileRequest) Format

func (r ProfileRequest) Format(state fmt.State, _ rune)

Format prevents formatting verbs from exposing request facts.

func (ProfileRequest) GoString

func (r ProfileRequest) GoString() string

GoString returns a constant protected request representation.

func (ProfileRequest) ProfileID

func (r ProfileRequest) ProfileID() ProfileID

ProfileID returns the exact requested identity.

func (ProfileRequest) String

func (r ProfileRequest) String() string

String returns a constant protected request summary.

func (ProfileRequest) Use

func (r ProfileRequest) Use() ProfileUse

Use returns the administrative selection purpose.

func (ProfileRequest) Valid

func (r ProfileRequest) Valid() bool

Valid reports whether the profile request is initialized.

func (ProfileRequest) ValidForLimits

func (r ProfileRequest) ValidForLimits(limits Limits) bool

ValidForLimits reports whether the profile request satisfies one narrowed datasource contract.

type ProfileUse

type ProfileUse uint8

ProfileUse identifies one administrative profile-selection purpose.

const (
	// ProfileUseOriginator selects an administrative originator profile.
	ProfileUseOriginator ProfileUse = iota + 1
	// ProfileUseOrdinaryTransit selects an administrative ordinary-transit profile.
	ProfileUseOrdinaryTransit
	// ProfileUseNextDomainTransit selects an administrative next-domain profile.
	ProfileUseNextDomainTransit
	// ProfileUseDeliveryStatus selects an administrative delivery-status profile.
	ProfileUseDeliveryStatus
)

func ParseProfileUse

func ParseProfileUse(value string) (ProfileUse, error)

ParseProfileUse parses one exact closed profile-use value.

func (ProfileUse) Format

func (u ProfileUse) Format(state fmt.State, _ rune)

Format prevents formatting verbs from exposing unknown numeric values.

func (ProfileUse) GoString

func (u ProfileUse) GoString() string

GoString returns the stable profile-use representation.

func (ProfileUse) Known

func (u ProfileUse) Known() bool

Known reports whether the use belongs to the closed vocabulary.

func (ProfileUse) MarshalJSON

func (u ProfileUse) MarshalJSON() ([]byte, error)

MarshalJSON emits only a known closed profile-use value.

func (ProfileUse) String

func (u ProfileUse) String() string

String returns the stable profile-use value or a constant unknown marker.

type Provider

type Provider interface {
	ResolveProfile(context.Context, ProfileRequest) (ResolvedProfile, error)
	ResolvePolicy(context.Context, PolicyRequest) (ResolvedPolicy, error)
}

Provider resolves immutable profile and administrative policy snapshots.

type ProviderState

type ProviderState uint8

ProviderState identifies the lifecycle of a concrete provider.

const (
	// ProviderStateReady permits lookups.
	ProviderStateReady ProviderState = iota + 1
	// ProviderStateDegraded rejects lookups until recovery.
	ProviderStateDegraded
	// ProviderStateClosed rejects all later work.
	ProviderStateClosed
)

func (ProviderState) Format

func (s ProviderState) Format(state fmt.State, _ rune)

Format prevents formatting verbs from exposing unknown numeric values.

func (ProviderState) GoString

func (s ProviderState) GoString() string

GoString returns the stable provider-state representation.

func (ProviderState) Known

func (s ProviderState) Known() bool

Known reports whether the provider state belongs to the closed vocabulary.

func (ProviderState) MarshalJSON

func (s ProviderState) MarshalJSON() ([]byte, error)

MarshalJSON emits only a known closed provider state.

func (ProviderState) String

func (s ProviderState) String() string

String returns the stable provider state or a constant unknown marker.

type RecordStatus

type RecordStatus uint8

RecordStatus identifies one administrative record state.

const (
	// RecordStatusActive permits an otherwise authorized record.
	RecordStatusActive RecordStatus = iota + 1
	// RecordStatusDisabled closes an administrative record.
	RecordStatusDisabled
)

func ParseRecordStatus

func ParseRecordStatus(value string) (RecordStatus, error)

ParseRecordStatus parses one exact closed record status.

func (RecordStatus) Format

func (s RecordStatus) Format(state fmt.State, _ rune)

Format prevents formatting verbs from exposing unknown numeric values.

func (RecordStatus) GoString

func (s RecordStatus) GoString() string

GoString returns the stable record-status representation.

func (RecordStatus) Known

func (s RecordStatus) Known() bool

Known reports whether the status belongs to the closed vocabulary.

func (RecordStatus) MarshalJSON

func (s RecordStatus) MarshalJSON() ([]byte, error)

MarshalJSON emits only a known closed record status.

func (RecordStatus) String

func (s RecordStatus) String() string

String returns the stable record status or a constant unknown marker.

type ResolvedPolicy

type ResolvedPolicy struct {
	// contains filtered or unexported fields
}

ResolvedPolicy is one immutable self-contained policy and profile result.

func NewResolvedPolicy

func NewResolvedPolicy(generation uint64, policy Policy, profile ResolvedProfile) (ResolvedPolicy, error)

NewResolvedPolicy constructs one complete generation-consistent policy result.

func (ResolvedPolicy) Format

func (r ResolvedPolicy) Format(state fmt.State, _ rune)

Format prevents formatting verbs from exposing result facts.

func (ResolvedPolicy) Generation

func (r ResolvedPolicy) Generation() uint64

Generation returns the immutable snapshot generation.

func (ResolvedPolicy) GoString

func (r ResolvedPolicy) GoString() string

GoString returns a constant protected result representation.

func (ResolvedPolicy) Policy

func (r ResolvedPolicy) Policy() Policy

Policy returns the immutable administrative binding.

func (ResolvedPolicy) Profile

func (r ResolvedPolicy) Profile() Profile

Profile returns the immutable same-generation datasource profile.

func (ResolvedPolicy) String

func (r ResolvedPolicy) String() string

String returns a constant protected result summary.

func (ResolvedPolicy) Valid

func (r ResolvedPolicy) Valid() bool

Valid reports whether the policy result is complete and generation-consistent.

func (ResolvedPolicy) ValidForLimits

func (r ResolvedPolicy) ValidForLimits(limits Limits) bool

ValidForLimits reports whether the resolved policy satisfies one narrowed datasource contract.

type ResolvedProfile

type ResolvedProfile struct {
	// contains filtered or unexported fields
}

ResolvedProfile is one immutable self-contained profile result.

func NewResolvedProfile

func NewResolvedProfile(generation uint64, profile Profile) (ResolvedProfile, error)

NewResolvedProfile constructs one complete immutable profile result.

func (ResolvedProfile) Format

func (r ResolvedProfile) Format(state fmt.State, _ rune)

Format prevents formatting verbs from exposing result facts.

func (ResolvedProfile) Generation

func (r ResolvedProfile) Generation() uint64

Generation returns the immutable snapshot generation.

func (ResolvedProfile) GoString

func (r ResolvedProfile) GoString() string

GoString returns a constant protected result representation.

func (ResolvedProfile) Profile

func (r ResolvedProfile) Profile() Profile

Profile returns the immutable complete datasource profile.

func (ResolvedProfile) ProfileID

func (r ResolvedProfile) ProfileID() ProfileID

ProfileID returns the exact resolved profile identity.

func (ResolvedProfile) String

func (r ResolvedProfile) String() string

String returns a constant protected result summary.

func (ResolvedProfile) Valid

func (r ResolvedProfile) Valid() bool

Valid reports whether the profile result is complete and initialized.

func (ResolvedProfile) ValidForLimits

func (r ResolvedProfile) ValidForLimits(limits Limits) bool

ValidForLimits reports whether the resolved profile satisfies one narrowed datasource contract.

type Rollout

type Rollout uint8

Rollout identifies one closed administrative rollout state.

const (
	// RolloutEnforce permits signing after every other check succeeds.
	RolloutEnforce Rollout = iota + 1
	// RolloutObserve resolves data but does not permit signing.
	RolloutObserve
	// RolloutOff disables the administrative binding.
	RolloutOff
)

func ParseRollout

func ParseRollout(value string) (Rollout, error)

ParseRollout parses one exact closed rollout value.

func (Rollout) Format

func (r Rollout) Format(state fmt.State, _ rune)

Format prevents formatting verbs from exposing unknown numeric values.

func (Rollout) GoString

func (r Rollout) GoString() string

GoString returns the stable rollout representation.

func (Rollout) Known

func (r Rollout) Known() bool

Known reports whether the rollout belongs to the closed vocabulary.

func (Rollout) MarshalJSON

func (r Rollout) MarshalJSON() ([]byte, error)

MarshalJSON emits only a known closed rollout value.

func (Rollout) String

func (r Rollout) String() string

String returns the stable rollout value or a constant unknown marker.

type TenantID

type TenantID struct {
	// contains filtered or unexported fields
}

TenantID identifies one exact administrative tenant.

func NewTenantID

func NewTenantID(value string) (TenantID, error)

NewTenantID validates one canonical tenant identifier.

func (TenantID) ByteLen

func (i TenantID) ByteLen() int

ByteLen returns the canonical identifier byte length.

func (TenantID) Format

func (i TenantID) Format(state fmt.State, _ rune)

Format prevents formatting verbs from exposing the identifier.

func (TenantID) GoString

func (i TenantID) GoString() string

GoString returns a constant protected tenant representation.

func (TenantID) String

func (i TenantID) String() string

String returns a constant protected tenant summary.

func (TenantID) Valid

func (i TenantID) Valid() bool

Valid reports whether the tenant identifier is initialized.

func (TenantID) WithinMaxBytes

func (i TenantID) WithinMaxBytes(maximum int) bool

WithinMaxBytes reports whether the identifier fits a valid narrowed bound.

type Usage

type Usage struct {
	// contains filtered or unexported fields
}

Usage contains bounded datasource work counters.

func NewUsage

func NewUsage(profiles, credentials, handles, policies, bytes int, limits Limits) (Usage, error)

NewUsage constructs one internally consistent bounded usage value.

func (Usage) Add

func (u Usage) Add(other Usage, limits Limits) (Usage, error)

Add returns checked aggregate usage under the supplied limits.

func (Usage) Bytes

func (u Usage) Bytes() int

Bytes returns the bounded decoded-string byte count.

func (Usage) Credentials

func (u Usage) Credentials() int

Credentials returns the bounded credential count.

func (Usage) Handles

func (u Usage) Handles() int

Handles returns the bounded handle count.

func (Usage) Policies

func (u Usage) Policies() int

Policies returns the bounded policy count.

func (Usage) Profiles

func (u Usage) Profiles() int

Profiles returns the bounded profile count.

func (Usage) Records

func (u Usage) Records() int

Records returns the derived provider-record work count.

func (Usage) ValidForLimits

func (u Usage) ValidForLimits(limits Limits) bool

ValidForLimits reports whether every usage counter satisfies one datasource contract.

Directories

Path Synopsis
Package flatfile decodes strict bounded versioned datasource documents into immutable in-memory snapshots.
Package flatfile decodes strict bounded versioned datasource documents into immutable in-memory snapshots.
Package memory provides the immutable static datasource reference provider.
Package memory provides the immutable static datasource reference provider.
Package signingprofile is the sole bridge from validated datasource results to signing profiles.
Package signingprofile is the sole bridge from validated datasource results to signing profiles.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL