rest

package
v0.0.0-...-7b34d14 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var From = &from{}

Functions

This section is empty.

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 Resource

type Resource struct {
	Meta ResourceMeta
	Spec model.ResourceSpec
}

func (*Resource) MarshalJSON

func (r *Resource) MarshalJSON() ([]byte, 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"`
}

Jump to

Keyboard shortcuts

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