web

package
v0.0.0-...-e73b65a Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProvidersRoot = "/providers"
)

Routes.

Variables

This section is empty.

Functions

func All

func All(container *container.Container) (all []libweb.RequestHandler)

All handlers.

Types

type Client

type Client = base.Client

func NewClient

func NewClient(provider *api.Provider) (client Client, err error)

Build an appropriate client.

type EventHandler

type EventHandler = base.EventHandler

Interfaces.

type Finder

type Finder = base.Finder

type NotFoundError

type NotFoundError = base.NotFoundError

type Param

type Param = base.Param

type Provider

type Provider map[string]interface{}

REST resource.

type ProviderClient

type ProviderClient struct {
	// contains filtered or unexported fields
}

Provider API client.

func (*ProviderClient) Find

func (r *ProviderClient) Find(resource interface{}, ref base.Ref) (err error)

Find an object by ref. Returns:

ProviderNotSupportedErr
ProviderNotReadyErr
NotFoundErr
RefNotUniqueErr

func (*ProviderClient) Finder

func (r *ProviderClient) Finder() Finder

Finder.

func (*ProviderClient) Get

func (r *ProviderClient) Get(resource interface{}, id string) (err error)

Get a resource. Returns:

ProviderNotSupportedErr
ProviderNotReadyErr
NotFoundErr

func (*ProviderClient) HasReason

func (r *ProviderClient) HasReason(reason string) bool

Match X-Reason reply header.

func (*ProviderClient) Host

func (r *ProviderClient) Host(ref *base.Ref) (object interface{}, err error)

Find a Host by ref. Returns the matching resource and:

ProviderNotSupportedErr
ProviderNotReadyErr
NotFoundErr
RefNotUniqueErr

func (*ProviderClient) List

func (r *ProviderClient) List(resource interface{}, param ...Param) (err error)

List a resource collection. Returns:

ProviderNotSupportedErr
ProviderNotReadyErr
NotFoundErr

func (*ProviderClient) Network

func (r *ProviderClient) Network(ref *base.Ref) (object interface{}, err error)

Find a network by ref. Returns the matching resource and:

ProviderNotSupportedErr
ProviderNotReadyErr
NotFoundErr
RefNotUniqueErr

func (*ProviderClient) Storage

func (r *ProviderClient) Storage(ref *base.Ref) (object interface{}, err error)

Find a storage object by ref. Returns the matching resource and:

ProviderNotSupportedErr
ProviderNotReadyErr
NotFoundErr
RefNotUniqueErr

func (*ProviderClient) VM

func (r *ProviderClient) VM(ref *base.Ref) (object interface{}, err error)

Find a VM by ref. Returns the matching resource and:

ProviderNotSupportedErr
ProviderNotReadyErr
NotFoundErr
RefNotUniqueErr

func (*ProviderClient) Watch

func (r *ProviderClient) Watch(resource interface{}, h EventHandler) (w *Watch, err error)

Watch a resource. Returns:

ProviderNotSupportedErr
ProviderNotReadyErr
NotFoundErr

func (*ProviderClient) Workload

func (r *ProviderClient) Workload(ref *base.Ref) (object interface{}, err error)

Find a workload by ref. Returns the matching resource and:

ProviderNotSupportedErr
ProviderNotReadyErr
NotFoundErr
RefNotUniqueErr

type ProviderHandler

type ProviderHandler struct {
	base.Handler
}

Provider handler.

func (*ProviderHandler) AddRoutes

func (h *ProviderHandler) AddRoutes(e *gin.Engine)

Add routes to the `gin` router.

func (ProviderHandler) Get

func (h ProviderHandler) Get(ctx *gin.Context)

Get a specific REST resource.

func (ProviderHandler) List

func (h ProviderHandler) List(ctx *gin.Context)

List resources in a REST collection.

type ProviderNotReadyError

type ProviderNotReadyError struct {
	*api.Provider
}

Resource kind cannot be resolved.

func (ProviderNotReadyError) Error

func (r ProviderNotReadyError) Error() string

type ProviderNotSupportedError

type ProviderNotSupportedError struct {
	*api.Provider
}

Resource kind cannot be resolved.

func (ProviderNotSupportedError) Error

type RefNotUniqueError

type RefNotUniqueError = base.RefNotUniqueError

type Watch

type Watch = base.Watch

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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