Documentation ¶
Index ¶
Constants ¶
View Source
const ( Root = libweb.Root ProviderCollection = "providers" ProvidersRoot = Root + "/" + ProviderCollection NsParam = libweb.NsParam ProviderParam = "provider" DetailParam = "detail" NameParam = "name" )
Root - all routes.
Variables ¶
View Source
var Settings = &settings.Settings
Application settings.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // Finder Finder() Finder // Get a resource. // The `resource` must be a pointer to a resource object. // Returns: // ProviderNotSupportedErr // ProviderNotReadyErr // NotFoundErr Get(resource interface{}, id string) error // List a collection. // The `list` must be a pointer to a slice of resource object. // Returns: // ProviderNotSupportedErr // ProviderNotReadyErr // NotFoundErr List(list interface{}, param ...Param) error // Get a resource by ref. // Returns: // ProviderNotSupportedErr // ProviderNotReadyErr // NotFoundErr // RefNotUniqueErr Find(resource interface{}, ref Ref) error // Find a VM by ref. // Returns the matching resource and: // ProviderNotSupportedErr // ProviderNotReadyErr // NotFoundErr // RefNotUniqueErr VM(ref *Ref) (interface{}, error) // Find a Network by ref. // Returns the matching resource and: // ProviderNotSupportedErr // ProviderNotReadyErr // NotFoundErr // RefNotUniqueErr Network(ref *Ref) (interface{}, error) // Find storage by ref. // Returns the matching resource and: // ProviderNotSupportedErr // ProviderNotReadyErr // NotFoundErr // RefNotUniqueErr Storage(ref *Ref) (interface{}, error) // Find host by ref. // Returns the matching resource and: // ProviderNotSupportedErr // ProviderNotReadyErr // NotFoundErr // RefNotUniqueErr Host(ref *Ref) (interface{}, error) }
REST Client.
type Finder ¶
type Finder interface { // Finder with client. With(client Client) Finder // Find a resource by ref. // Returns: // ProviderNotSupportedErr // ProviderNotReadyErr // NotFoundErr // RefNotUniqueErr ByRef(resource interface{}, ref Ref) error // Find a VM by ref. // Returns the matching resource and: // ProviderNotSupportedErr // ProviderNotReadyErr // NotFoundErr // RefNotUniqueErr VM(ref *Ref) (interface{}, error) // Find a Network by ref. // Returns the matching resource and: // ProviderNotSupportedErr // ProviderNotReadyErr // NotFoundErr // RefNotUniqueErr Network(ref *Ref) (interface{}, error) // Find storage by ref. // Returns the matching resource and: // ProviderNotSupportedErr // ProviderNotReadyErr // NotFoundErr // RefNotUniqueErr Storage(ref *Ref) (interface{}, error) // Find host by ref. // Returns the matching resource and: // ProviderNotSupportedErr // ProviderNotReadyErr // NotFoundErr // RefNotUniqueErr Host(ref *Ref) (interface{}, error) }
Resource Finder.
type Handler ¶
type Handler struct { libweb.Consistent libweb.Paged // Container Container *libcontainer.Container // Provider referenced in the request. Provider *api.Provider // Reconciler responsible for the provider. Reconciler libcontainer.Reconciler // Resources include details. Detail bool }
Base handler.
type NotFoundError ¶
type NotFoundError struct {
Ref
}
Resource not found.
func (NotFoundError) Error ¶
func (r NotFoundError) Error() string
type RefNotUniqueError ¶
type RefNotUniqueError struct {
Ref
}
Reference matches multiple resources.
func (RefNotUniqueError) Error ¶
func (r RefNotUniqueError) Error() string
type Resolver ¶
type Resolver interface { // Find the API path for the specified resource. Path(resource interface{}, id string) (string, error) }
Resolves resources to API paths.
type ResourceNotResolvedError ¶
type ResourceNotResolvedError struct {
Object interface{}
}
Resource kind cannot be resolved.
func (ResourceNotResolvedError) Error ¶
func (r ResourceNotResolvedError) Error() string
type RestClient ¶
type RestClient struct { Resolver // Bearer token. Token string // Host <host>:<port> Host string // Parameters Params Params // contains filtered or unexported fields }
REST API client.
Click to show internal directories.
Click to hide internal directories.