rest

package
v0.1.0-rc1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// Key used for the Page query param
	PaginationPageQueryKey = "page"
	// Key used for the PerPage query param
	PaginationPerPageQueryKey = "per_page"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Err       error     `json:"-"`
	Code      int       `json:"-"`
	Text      string    `json:"-"`
	Message   string    `json:"message"`
	Detail    string    `json:"detail"`
	Timestamp time.Time `json:"timestamp"`
}

APIError :

func WrapControllerError

func WrapControllerError(e error) *APIError

WrapControllerError :

func (APIError) Error

func (e APIError) Error() string

Error :

type Handler

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

Handler :

func NewHandler

func NewHandler(c *controller.Controller, middleware Middleware) (*Handler, error)

NewHandler : Create a new REST API handler

func (*Handler) CreateHost

func (h *Handler) CreateHost(c echo.Context) error

CreateHost :

func (*Handler) CreateInterface

func (h *Handler) CreateInterface(c echo.Context) error

CreateInterface :

func (h *Handler) CreateLink(c echo.Context) error

CreateLink :

func (*Handler) CreateNetwork

func (h *Handler) CreateNetwork(c echo.Context) error

CreateNetwork :

func (*Handler) CreateToken

func (h *Handler) CreateToken(c echo.Context) error

CreateToken :

func (*Handler) DeleteHost

func (h *Handler) DeleteHost(c echo.Context) error

DeleteHost :

func (*Handler) DeleteInterface

func (h *Handler) DeleteInterface(c echo.Context) error

DeleteInterface :

func (h *Handler) DeleteLink(c echo.Context) error

DeleteLink :

func (*Handler) DeleteNetwork

func (h *Handler) DeleteNetwork(c echo.Context) error

DeleteNetwork :

func (*Handler) DeleteToken

func (h *Handler) DeleteToken(c echo.Context) error

DeleteToken :

func (*Handler) GetHost

func (h *Handler) GetHost(c echo.Context) error

GetHost :

func (*Handler) GetInterface

func (h *Handler) GetInterface(c echo.Context) error

GetInterface :

func (h *Handler) GetLink(c echo.Context) error

GetLink :

func (*Handler) GetNetwork

func (h *Handler) GetNetwork(c echo.Context) error

GetNetwork :

func (*Handler) GetSelfSettings

func (h *Handler) GetSelfSettings(c echo.Context) error

GetSelfSettings :

func (*Handler) GetSelfToken

func (h *Handler) GetSelfToken(c echo.Context) error

GetSelfToken :

func (*Handler) GetToken

func (h *Handler) GetToken(c echo.Context) error

GetToken :

func (*Handler) Healthcheck

func (h *Handler) Healthcheck(ctx echo.Context) error

Healthcheck :

func (*Handler) ListHosts

func (h *Handler) ListHosts(c echo.Context) error

ListHosts :

func (*Handler) ListInterfaces

func (h *Handler) ListInterfaces(c echo.Context) error

ListInterfaces :

func (h *Handler) ListLinks(c echo.Context) error

ListLinks :

func (*Handler) ListNetworks

func (h *Handler) ListNetworks(c echo.Context) error

ListNetworks :

func (*Handler) ListTokens

func (h *Handler) ListTokens(c echo.Context) error

ListTokens :

func (*Handler) RegisterRoutes

func (h *Handler) RegisterRoutes(e *echo.Echo)

RegisterRoutes :

func (*Handler) SynchronizeSelf

func (h *Handler) SynchronizeSelf(c echo.Context) error

SynchronizeSelf :

func (*Handler) UpdateHost

func (h *Handler) UpdateHost(c echo.Context) error

UpdateHost :

func (*Handler) UpdateInterface

func (h *Handler) UpdateInterface(c echo.Context) error

UpdateInterface :

func (h *Handler) UpdateLink(c echo.Context) error

UpdateLink :

func (*Handler) UpdateNetwork

func (h *Handler) UpdateNetwork(c echo.Context) error

UpdateNetwork :

func (*Handler) UpdateSelfState

func (h *Handler) UpdateSelfState(c echo.Context) error

UpdateSelfState :

func (*Handler) UpdateToken

func (h *Handler) UpdateToken(c echo.Context) error

UpdateToken :

type Middleware

type Middleware struct {
	VerifyAuth echo.MiddlewareFunc
	AdmitHost  echo.MiddlewareFunc
}

Middleware :

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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