orderedset

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authority

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

Authority owns one isolated family of immutable roots.

func NewAuthority

func NewAuthority() *Authority

NewAuthority creates an isolated root authority.

func (*Authority) Empty

func (a *Authority) Empty() Root

Empty returns the authority's canonical empty root.

type Root

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

Root is an opaque immutable ordered-set root.

func BuildPackedSorted

func BuildPackedSorted(authority *Authority, scope Scope, values []string) (Root, error)

BuildPackedSorted creates an authenticated compact root from strictly increasing values.

func BuildSorted

func BuildSorted(authority *Authority, scope Scope, values []string) (Root, error)

BuildSorted creates an authenticated root from strictly increasing values.

func (Root) Add

func (r Root) Add(authority *Authority, scope Scope, value string) (Root, bool, error)

Add returns a root containing value and whether the set changed.

func (Root) Contains

func (r Root) Contains(authority *Authority, scope Scope, value string) (bool, error)

Contains reports whether value is present.

func (Root) Delete

func (r Root) Delete(authority *Authority, scope Scope, value string) (Root, bool, error)

Delete returns a root without value and whether the set changed.

func (Root) Len

func (r Root) Len(authority *Authority, scope Scope) (int, error)

Len returns the authenticated element count.

func (Root) Range

func (r Root) Range(authority *Authority, scope Scope, visit func(string) bool) error

Range visits values in ascending order until visit returns false.

func (Root) SameRoot

func (r Root) SameRoot(authority *Authority, scope Scope, other Root) (bool, error)

SameRoot reports authenticated process-local root identity.

func (Root) Update

func (r Root) Update(authority *Authority, scope Scope, membership map[string]bool) (Root, error)

Update applies membership assignments without copying a packed root per value.

func (Root) ValidateAuthentication

func (r Root) ValidateAuthentication(authority *Authority) error

ValidateAuthentication verifies root ownership and its immutable representation in O(1).

func (Root) ValidateOwnership

func (r Root) ValidateOwnership(authority *Authority, scope Scope) error

ValidateOwnership verifies provenance and exact scope ownership in O(1).

func (Root) Values

func (r Root) Values(authority *Authority, scope Scope) ([]string, error)

Values returns a detached sorted projection.

type Scope

type Scope struct {
	Domain uint8
	Key    string
}

Scope binds a non-empty root to one exact caller-owned identity.

Jump to

Keyboard shortcuts

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