selector

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: Apache-2.0, MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Selector

type Selector []segment

Selector describes a UCAN policy selector, as specified here: https://github.com/ucan-wg/delegation/blob/4094d5878b58f5d35055a3b93fccda0b8329ebae/README.md#selectors

func MustParse

func MustParse(sel string) Selector

func Parse

func Parse(str string) (Selector, error)

func (Selector) Select

func (s Selector) Select(subject ipld.Node) (ipld.Node, error)

Select perform the selection described by the selector on the input IPLD DAG. Select can return:

  • exactly one matched IPLD node
  • a resolutionErr error if not being able to resolve to a node
  • nil and no errors, if the selector couldn't match on an optional segment (with ?).

func (Selector) String

func (s Selector) String() string

Jump to

Keyboard shortcuts

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