resource

package
v0.0.0-...-ad3a29e Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InvalidValueError

type InvalidValueError struct {
	Name  string
	Value interface{}
}

func (InvalidValueError) Error

func (e InvalidValueError) Error() string

type List

type List interface {
	Meta() Meta
	Items() []Resource
}

Resource represents a list of Linode resources.

type Meta

type Meta interface {
	Name() string
	DefaultColumns() []string
	RequiredColumns() []string
}

type NoPropertyError

type NoPropertyError struct {
	Name string
}

func (NoPropertyError) Error

func (e NoPropertyError) Error() string

type NotUpdateableError

type NotUpdateableError struct {
	Name string
}

func (NotUpdateableError) Error

func (e NotUpdateableError) Error() string

type Property

type Property struct {
	// Getter gets the property
	Getter func(context.Context) (interface{}, error)

	// Setter sets the property. Setter is not required
	Setter func(context.Context, interface{}) error

	sync.Once
	// contains filtered or unexported fields
}

func (*Property) GetWithCache

func (p *Property) GetWithCache(ctx context.Context) (interface{}, error)

GetWithCache

func (*Property) IsSettable

func (p *Property) IsSettable() bool

IsSettable returns whether or not a property has a setter.

type PropertyMap

type PropertyMap map[string]Property

PropertyMap represents a mapping of property names to getters and setters.

type Resource

type Resource interface {
	Properties() PropertyMap
}

Resource represents a Linode resource

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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