stateref

package
v0.8.0-a.22 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendInstanceKey

func AppendInstanceKey(template string, key string) (string, error)

AppendInstanceKey returns template with key set on its final segment.

func Parent

func Parent(address string) (string, error)

Parent returns the slash parent of address, or empty for a root segment.

func Same

func Same(a, b EntryRef) bool

func SplitInstanceKey

func SplitInstanceKey(address string) (template string, key string, ok bool, err error)

SplitInstanceKey removes and returns the final segment's static key.

func Template

func Template(address string) (string, error)

Template removes static keys from every segment in address.

func ValidateAddress

func ValidateAddress(address string) error

Types

type Category

type Category string
const (
	CategoryResource   Category = "resource"
	CategoryDataSource Category = "data-source"
	CategoryAction     Category = "action"
)

type EntryRef

type EntryRef struct {
	Address string
}

func Parse

func Parse(s string) (EntryRef, error)

func (EntryRef) String

func (r EntryRef) String() string

type StateAddressSegment

type StateAddressSegment struct {
	Category Category
	Name     string
	Key      *StringKey
}

func (StateAddressSegment) String

func (s StateAddressSegment) String() string

type StateRef

type StateRef struct {
	Segments []StateAddressSegment
}

func ParseStateRef

func ParseStateRef(s string) (StateRef, error)

func (StateRef) String

func (s StateRef) String() string

type StringKey

type StringKey struct {
	Value string
}

Jump to

Keyboard shortcuts

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