scope

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Set

type Set map[string]struct{}

Set is an unordered set of scope strings.

func New

func New(scopes ...string) Set

New creates a Set from individual scope strings.

func Parse

func Parse(s string) Set

Parse splits a space-separated scope string into a Set. Empty input returns an empty (non-nil) set.

func (Set) Contains

func (ss Set) Contains(scope string) bool

Contains reports whether scope is in the set.

func (Set) Equal

func (ss Set) Equal(other Set) bool

Equal reports whether two ScopeSets contain the same scopes.

func (Set) Intersect

func (ss Set) Intersect(other Set) Set

Intersect returns a new Set containing only scopes present in both sets.

func (Set) IsEmpty

func (ss Set) IsEmpty() bool

IsEmpty reports whether the set has no scopes.

func (Set) IsSubset

func (ss Set) IsSubset(other Set) bool

IsSubset reports whether every scope in ss is also in other.

func (Set) Len

func (ss Set) Len() int

Len returns the number of scopes in the set.

func (Set) Slice

func (ss Set) Slice() []string

Slice returns the scopes as a sorted string slice.

func (Set) String

func (ss Set) String() string

String returns the scopes as a sorted space-separated string. Sorting ensures deterministic output.

func (Set) Union

func (ss Set) Union(other Set) Set

Union returns a new Set containing all scopes from both sets.

Jump to

Keyboard shortcuts

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