rest

package
v0.0.0-...-7febb3a Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromPlainJson

func FromPlainJson(data []byte, v interface{}) error

func Logging

func Logging(l *logging.Logger) echo.MiddlewareFunc

func ToPlainJson

func ToPlainJson(v interface{}) ([]byte, error)

func Traffic

func Traffic(acceptTraffic *atomic.Bool) echo.MiddlewareFunc

Types

type ErrorMessage

type ErrorMessage struct {
	ErrorCode int    `json:"error_code"`
	Message   string `json:"message"`
}

type Response

type Response struct {
	IsError bool            `json:"is_error"`
	Message string          `json:"message"`
	Data    json.RawMessage `json:"data"`
	// contains filtered or unexported fields
}

func NewResponse

func NewResponse(c echo.Context) *Response

func (*Response) Marshal

func (res *Response) Marshal() []byte

func (*Response) Send

func (res *Response) Send() error

func (*Response) SetError

func (res *Response) SetError(err error) *Response

func (*Response) SetErrorWithText

func (res *Response) SetErrorWithText(errText string) *Response

func (*Response) SetHttpCode

func (res *Response) SetHttpCode(value int) *Response

func (*Response) SetResponseBody

func (res *Response) SetResponseBody(data interface{}) *Response

func (*Response) Unmarshal

func (res *Response) Unmarshal(v interface{}) error

type Server

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

func NewServer

func NewServer(svc *services.SystemServices, appConfigs ...*config.Config) (*Server, error)

func (*Server) Close

func (s *Server) Close()

func (*Server) Run

func (s *Server) Run() error

func (*Server) UpdateBrokerStatus

func (s *Server) UpdateBrokerStatus(state bool)

Jump to

Keyboard shortcuts

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