server

package
v0.0.0-...-046bdf9 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

ProviderSet is server providers.

Functions

func NewGRPCServer

func NewGRPCServer(c *conf.Server, notification *service.NotificationService, logger log.Logger) *grpc.Server

NewGRPCServer new a gRPC server.

func NewHTTPServer

func NewHTTPServer(c *conf.Server, notification *service.NotificationService, logger log.Logger) *http.Server

NewHTTPServer new an HTTP server.

Types

type HTTPError

type HTTPError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

func FromError

func FromError(err error) *HTTPError

FromError try to convert an error to *HTTPError.

func (*HTTPError) Error

func (e *HTTPError) Error() string

type HTTPOk

type HTTPOk struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
	Ts      int64       `json:"ts"`
}

Jump to

Keyboard shortcuts

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