state

package
v2.7.1 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewKey

func NewKey(kind, name string) interface{}

Types

type Key

type Key interface {

	// Name returns the key within the given namespace
	Name() string

	// Kind returns the kind of key
	Kind() string

	// String returns a string representation of the key
	String() string

	// Equal reports whether two keys are equal. Two keys are equal if they are both nil, or if their kinds and names are equal.
	Equal(Key) bool

	// Encode returns an opaque representation of the key suitable for use in HTML and URLs
	Encode() string

	// NativeKey returns the storage provider specific representation of the key
	NativeKey() interface{}
}

func DecodeKey

func DecodeKey(encoded string) (*Key, error)

type KeyImpl

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

func (*KeyImpl) Encode

func (k *KeyImpl) Encode() string

func (*KeyImpl) Equal

func (k *KeyImpl) Equal(key Key) bool

func (*KeyImpl) Kind

func (k *KeyImpl) Kind() string

func (*KeyImpl) Name

func (k *KeyImpl) Name() string

func (*KeyImpl) NativeKey

func (k *KeyImpl) NativeKey() interface{}

func (*KeyImpl) String

func (k *KeyImpl) String() string

type StateProvider

type StateProvider interface {
	DecodeKey(string) (*Key, error)
	NewKey(string, string) (*Key, error)
}

Jump to

Keyboard shortcuts

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