ern

package
v0.0.0-...-5dfe74e Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Resolve

func Resolve(ctx context.Context, r Resolver, ern Name) (map[string]any, error)

func Valid

func Valid(ern string) bool

Types

type InvalidErr

type InvalidErr struct{}

InvalidErr is triggered when ERN has correct format but points to an unknown resource

func (InvalidErr) Error

func (InvalidErr) Error() string

type MalformedErr

type MalformedErr struct{}

MalformedErr is triggered when string does not follow ERN format

func (MalformedErr) Error

func (MalformedErr) Error() string

type Name

type Name []string

func Parent

func Parent(ern string) Name

func Parse

func Parse(ern string) Name

func (Name) Includes

func (e Name) Includes(parent Name) bool

func (Name) MarshalBinary

func (e Name) MarshalBinary() ([]byte, error)

func (Name) MarshalJSON

func (e Name) MarshalJSON() ([]byte, error)

func (Name) Match

func (e Name) Match(m Name) bool

func (Name) Parent

func (e Name) Parent() Name

func (*Name) Scan

func (e *Name) Scan(src interface{}) error

func (Name) String

func (e Name) String() string

func (*Name) UnmarshalBinary

func (e *Name) UnmarshalBinary(data []byte) error

func (*Name) UnmarshalJSON

func (e *Name) UnmarshalJSON(data []byte) error

func (Name) Valid

func (e Name) Valid() bool

func (Name) Value

func (e Name) Value() (driver.Value, error)

type Resolver

type Resolver interface {
	ResolveERN(context.Context, Resolver, Name) (map[string]any, error)
}

func NewResolver

func NewResolver(rr ...Resolver) Resolver

type ResolverFunc

type ResolverFunc func(context.Context, Resolver, Name) (map[string]any, error)

func (ResolverFunc) ResolveERN

func (f ResolverFunc) ResolveERN(ctx context.Context, r Resolver, ern Name) (map[string]any, error)

Jump to

Keyboard shortcuts

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