api

package
Version: v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2017 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

API is the data holder for the API

func NewAPI

func NewAPI(config *conf.Configuration, db *bolt.DB) *API

NewAPI will create an api instance that is ready to start

func (*API) EnvironmentGet

func (api *API) EnvironmentGet(ctx echo.Context) error

func (*API) EnvironmentUpdate

func (api *API) EnvironmentUpdate(ctx echo.Context) error

func (*API) InstanceCreate

func (api *API) InstanceCreate(ctx echo.Context) error

func (*API) InstanceDelete

func (api *API) InstanceDelete(ctx echo.Context) error

func (*API) InstanceGet

func (api *API) InstanceGet(ctx echo.Context) error

func (*API) InstanceList

func (api *API) InstanceList(ctx echo.Context) error

func (*API) InstanceUpdate

func (api *API) InstanceUpdate(ctx echo.Context) error

func (*API) MetaData

func (api *API) MetaData(ctx echo.Context) error

func (*API) Preview

func (api *API) Preview(ctx echo.Context) error

func (*API) Start

func (api *API) Start() error

Start will start the API on the specified port

func (*API) Stop

func (api *API) Stop() error

Stop will shutdown the engine internally

func (*API) UserData

func (api *API) UserData(ctx echo.Context) error

type APIListResponse

type APIListResponse struct {
	Page     int         `json:"page"`
	PageSize int         `json:"pageSize"`
	Total    int         `json:"total"`
	Items    interface{} `json:"items"`
}

type APIResponse

type APIResponse struct {
	Status  enums.APIResponseStatus `json:"status"`
	Message string                  `json:"message"`
	Errors  []ErrorResponseItem     `json:"errors,omitempty"`
}

func NewAPIResponseFromValidationError

func NewAPIResponseFromValidationError(errors validator.ValidationErrors) *APIResponse

type CustomValidator

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

func (*CustomValidator) Validate

func (cv *CustomValidator) Validate(i interface{}) error

type ErrorResponseItem

type ErrorResponseItem struct {
	Field   string `json:"field,omitempty"`
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to