rest

package
v0.0.0-...-d3c9bd8 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var From = &from{}
View Source
var JSON = &unmarshaler{unmarshalFn: json.Unmarshal}
View Source
var To = &to{}
View Source
var YAML = &unmarshaler{unmarshalFn: func(bytes []byte, i interface{}) error {
	return yaml.Unmarshal(bytes, i)
}}

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 InvalidResourceError

type InvalidResourceError struct {
	Reason string
}

func (*InvalidResourceError) Error

func (e *InvalidResourceError) Error() string

func (*InvalidResourceError) Is

func (e *InvalidResourceError) Is(target error) bool

type Resource

type Resource interface {
	GetMeta() v1alpha1.ResourceMeta
	GetSpec() core_model.ResourceSpec
}

type ResourceApi

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

func NewResourceApi

func NewResourceApi(scope model.ResourceScope, 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() core_model.Resource
}

func (*ResourceListReceiver) UnmarshalJSON

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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