api

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

View Source
var StaticAssets embed.FS

Functions

func ToPlainJson

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

Types

type ChannelsResponse

type ChannelsResponse struct {
	Host       string
	LastUpdate time.Time
	Channels   []*metrics.ChannelStats
	Summery    []*metrics.ChannelsSummery
}

type ClientResponse

type ClientResponse struct {
	Host          string
	LastUpdate    time.Time
	TotalClients  int
	TotalMessages float64
	TotalVolume   float64
	TotalErrors   float64
	TotalOnline   int
	Clients       []*metrics.ClientsStats
}

type Response

type Response struct {
	Error       bool            `json:"error"`
	ErrorString string          `json:"error_string"`
	Data        json.RawMessage `json:"data"`
	// contains filtered or unexported fields
}

func NewResponse

func NewResponse(c echo.Context) *Response

func (*Response) Send

func (res *Response) Send() error

func (*Response) SendData

func (res *Response) SendData(data []byte) 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 CreateApiServer

func CreateApiServer(ctx context.Context, broker *broker.Service, appConfigs ...*config.Config) (*Server, error)

func (*Server) AddHealthFunc

func (s *Server) AddHealthFunc(fn func() json.RawMessage)

func (*Server) Close

func (s *Server) Close()

func (*Server) InitApiService

func (s *Server) InitApiService(ctx context.Context, array *array.Array) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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