handlers

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: May 15, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const JSONIndent string = "    "

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiError

type ApiError struct {
	Name        string      `json:"name"`
	Description interface{} `json:"error,omitempty"`
}

func (*ApiError) Error

func (err *ApiError) Error() string

type ApiErrorWrapper added in v0.1.1

type ApiErrorWrapper interface {
	Status() int
	Error() string
	ApiError() *ApiError
}

type ApiResponse

type ApiResponse struct {
	Ok      bool        `json:"ok"`
	Payload interface{} `json:"payload"`
	Error   *ApiError   `json:"error,omitempty"`
}

type CustomErrorWrapper added in v0.1.1

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

func NewCustomError added in v0.1.1

func NewCustomError(status int, name string, description interface{}) *CustomErrorWrapper

func (*CustomErrorWrapper) ApiError added in v0.1.1

func (err *CustomErrorWrapper) ApiError() *ApiError

func (*CustomErrorWrapper) Error added in v0.1.1

func (err *CustomErrorWrapper) Error() string

func (*CustomErrorWrapper) Status added in v0.1.1

func (err *CustomErrorWrapper) Status() int

type DefaultHandler

type DefaultHandler struct {
	Logger *log.Logger
}

func (*DefaultHandler) ErrorHandler

func (handler *DefaultHandler) ErrorHandler(err error, ctx echo.Context)

func (*DefaultHandler) MiddlewareLogRaw

func (handler *DefaultHandler) MiddlewareLogRaw(next echo.HandlerFunc) echo.HandlerFunc

func (*DefaultHandler) MiddlewarePerformaceLog

func (handler *DefaultHandler) MiddlewarePerformaceLog(next echo.HandlerFunc) echo.HandlerFunc

func (*DefaultHandler) MiddlewareServerHeaders added in v0.1.1

func (handler *DefaultHandler) MiddlewareServerHeaders(prog string, ver version.Version) echo.MiddlewareFunc

type HttpErrorWrapper added in v0.1.1

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

func NewHttpError added in v0.1.1

func NewHttpError(status int, description interface{}) *HttpErrorWrapper

func (*HttpErrorWrapper) ApiError added in v0.1.1

func (err *HttpErrorWrapper) ApiError() *ApiError

func (*HttpErrorWrapper) Error added in v0.1.1

func (err *HttpErrorWrapper) Error() string

func (*HttpErrorWrapper) Status added in v0.1.1

func (err *HttpErrorWrapper) Status() int

type Node

type Node struct {
	Name     string      `json:"name"`
	NodeType db.NodeType `json:"type"`
}

type NodeHandler

type NodeHandler struct {
	Logger   *log.Logger
	Database *db.Database
}

func (*NodeHandler) Create

func (handler *NodeHandler) Create(ctx echo.Context) error

func (*NodeHandler) Delete

func (handler *NodeHandler) Delete(ctx echo.Context) error

func (*NodeHandler) DeleteUUID

func (handler *NodeHandler) DeleteUUID(ctx echo.Context) error

func (*NodeHandler) Dump

func (handler *NodeHandler) Dump(ctx echo.Context) error

func (*NodeHandler) Get

func (handler *NodeHandler) Get(ctx echo.Context) error

func (*NodeHandler) GetUUID

func (handler *NodeHandler) GetUUID(ctx echo.Context) error

func (*NodeHandler) Update

func (handler *NodeHandler) Update(ctx echo.Context) error

func (*NodeHandler) UpdateUUID

func (handler *NodeHandler) UpdateUUID(ctx echo.Context) error

type Root

type Root struct {
	Name string `json:"name"`
}

type RootHandler

type RootHandler struct {
	Logger   *log.Logger
	Database *db.Database
}

func (*RootHandler) Create

func (handler *RootHandler) Create(ctx echo.Context) error

func (*RootHandler) Delete

func (handler *RootHandler) Delete(ctx echo.Context) error

func (*RootHandler) Get

func (handler *RootHandler) Get(ctx echo.Context) error

func (*RootHandler) List

func (handler *RootHandler) List(ctx echo.Context) error

type SimplePayload

type SimplePayload struct {
	Payload interface{} `json:"value"`
}

type User

type User struct {
	UserName string `json:"user"`
	Password string `json:"password"`
	CanWrite bool   `json:"writeAllowed,omitempty"`
}

type UserHandler

type UserHandler struct {
	Logger   *log.Logger
	Database *db.Database
}

func (*UserHandler) AuthMiddleware

func (handler *UserHandler) AuthMiddleware(userName, password string, ctx echo.Context) (bool, error)

func (*UserHandler) Create

func (handler *UserHandler) Create(ctx echo.Context) error

func (*UserHandler) Delete

func (handler *UserHandler) Delete(ctx echo.Context) error

func (*UserHandler) Get

func (handler *UserHandler) Get(ctx echo.Context) error

func (*UserHandler) List

func (handler *UserHandler) List(ctx echo.Context) error

func (*UserHandler) UpdatePassword

func (handler *UserHandler) UpdatePassword(ctx echo.Context) error

func (*UserHandler) UpdateWriting

func (handler *UserHandler) UpdateWriting(ctx echo.Context) error

Jump to

Keyboard shortcuts

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