context_service

package
v0.0.0-...-ee95d54 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSErrorResp

type CSErrorResp struct {
	ErrorMessage string `json:"error_message,omitempty"`
}

Custom error

func (*CSErrorResp) Error

func (e *CSErrorResp) Error() string

type CSJsonResp

type CSJsonResp struct {
	Result interface{} `json:"result"`
}

type ContextService

type ContextService struct {
	echo.Context
}

func New

func New(c echo.Context) *ContextService

func (*ContextService) BindToDTO

func (cs *ContextService) BindToDTO(requestForm, dtoForm interface{}) error

BindToDTO builds a request of the given form based on the context and converts it to a DTO.

func (*ContextService) BindToRequest

func (cs *ContextService) BindToRequest(request interface{}) error

BindToRequest populates the request fields based on the context path and query parameters and body and validates the result.

func (*ContextService) Json

func (cs *ContextService) Json(code int, data interface{}) error

func (*ContextService) JsonEmpty

func (cs *ContextService) JsonEmpty(code int) error

func (*ContextService) JsonError

func (cs *ContextService) JsonError(code int, err error) error

Jump to

Keyboard shortcuts

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