Documentation

Index

Constants

This section is empty.

Variables

View Source
var From = &from{}

Functions

func UnmarshallToCore

func UnmarshallToCore(bytes []byte) (model.Resource, error)

Types

type Api

type Api interface {
	GetResourceApi(model.ResourceType) (ResourceApi, error)
}

type ApiDescriptor

type ApiDescriptor struct {
	Resources map[model.ResourceType]ResourceApi
}

func (*ApiDescriptor) GetResourceApi

func (m *ApiDescriptor) GetResourceApi(typ model.ResourceType) (ResourceApi, error)

type ByMeta

type ByMeta []*Resource

func (ByMeta) Len

func (a ByMeta) Len() int

func (ByMeta) Less

func (a ByMeta) Less(i, j int) bool

func (ByMeta) Swap

func (a ByMeta) Swap(i, j int)

type Resource

type Resource struct {
	Meta ResourceMeta
	Spec model.ResourceSpec
}

func Unmarshall

func Unmarshall(bytes []byte) (*Resource, error)

func (*Resource) MarshalJSON

func (r *Resource) MarshalJSON() ([]byte, error)

func (*Resource) ToCore

func (r *Resource) ToCore() (model.Resource, error)

func (*Resource) UnmarshalJSON

func (r *Resource) UnmarshalJSON(data []byte) error

type ResourceApi

type ResourceApi interface {
	List(mesh string) string
	Item(mesh string, name string) string
}

func NewResourceApi

func NewResourceApi(resType model.ResourceType, path string) ResourceApi

type ResourceList

type ResourceList struct {
	Total uint32      `json:"total"`
	Items []*Resource `json:"items"`
	Next  *string     `json:"next"`
}

type ResourceListReceiver

type ResourceListReceiver struct {
	ResourceList
	NewResource func() model.Resource
}

func (*ResourceListReceiver) UnmarshalJSON

func (rec *ResourceListReceiver) UnmarshalJSON(data []byte) error

type ResourceMeta

type ResourceMeta struct {
	Type             string    `json:"type"`
	Mesh             string    `json:"mesh,omitempty"`
	Name             string    `json:"name"`
	CreationTime     time.Time `json:"creationTime"`
	ModificationTime time.Time `json:"modificationTime"`
}

func (*ResourceMeta) GetCreationTime

func (r *ResourceMeta) GetCreationTime() time.Time

func (*ResourceMeta) GetMesh

func (r *ResourceMeta) GetMesh() string

func (*ResourceMeta) GetModificationTime

func (r *ResourceMeta) GetModificationTime() time.Time

func (*ResourceMeta) GetName

func (r *ResourceMeta) GetName() string

func (*ResourceMeta) GetNameExtensions

func (r *ResourceMeta) GetNameExtensions() model.ResourceNameExtensions

func (*ResourceMeta) GetVersion

func (r *ResourceMeta) GetVersion() string