api

package
v0.0.0-...-0bc4b66 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NsGlobal means global namespace
	NsGlobal string = "global"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	// Source is the API source
	Source() Source
	// Resources returns all API resources
	Resources() []Resource
	// Get returns all API resources matching the query
	Get(*query.Query) ([]Resource, error)
}

API is a map of all available API resources

type Client

type Client interface {
	Discoverer
	Mapper
}

Client discovers API resources and maps API objects

type Discoverer

type Discoverer interface {
	// Discover returns the discovered API
	Discover() (API, error)
}

Discoverer discovers remote API

type Link interface {
	// UID is link UID
	UID() uuid.UID
	// From returns the UID of the linking object
	From() uuid.UID
	// To returns the UID of the object the link points to
	To() uuid.UID
	// Relation returns the type of the link relation
	Relation() Relation
}

Link defines API object relation to another object

type Mapper

type Mapper interface {
	// Map returns the API tpology
	Map(API) (Top, error)
}

Mapper maps the API into topology

type Object

type Object interface {
	// UID is Object uniqque id
	UID() uuid.UID
	// Name is Object name
	Name() string
	// Namespace is Object namespace
	Namespace() string
	// Resource returns Object API resource
	Resource() Resource
	// Link links object to another object
	Link(uuid.UID, Relation)
	// Links returns all Object links
	Links() []Link
}

Object is an instance of a Resource

type Relation

type Relation interface {
	// String returns relation description
	String() string
}

Relation defines remote link relation

type Resource

type Resource interface {
	// Name returns resource name
	Name() string
	// Kind returns resource kind
	Kind() string
	// Group retrurns resource group
	Group() string
	// Version returns resource version
	Version() string
	// Namespaced returns true if the resource is namespaced
	Namespaced() bool
}

Resource is an API resource

type Source

type Source interface {
	// String returns API source as string
	String() string
}

Source is the API source

type Top

type Top interface {
	// Objects returns all objects in the topology
	Objects() []Object
	// Get returns all API objects matching the query
	Get(*query.Query) ([]Object, error)
}

Top is an API topology i.e. the map of Objects

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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