Documentation ¶
Index ¶
- type Context
- type ErrorResponse
- type Handler
- type HandlerElement
- type HandlerFunc
- type JsonRequestType
- type Middleware
- type Service
- func (s *Service) ExecuteCommand(path string, data string) error
- func (s *Service) GetBuild(def string) string
- func (s *Service) GetConfig(path string, def interface{}) interface{}
- func (s *Service) RegisterConfig(path string)
- func (s *Service) RegisterHandlers(handlers Handler)
- func (s *Service) RegisterInitTask(initTask func())
- func (s *Service) RegisterMiddlewares(middlewares []Middleware)
- func (s *Service) RegisterTasks(tasks []func())
- func (s *Service) SetLogger()
- func (s *Service) Start()
- func (s *Service) StartHttp()
- func (s *Service) StartServices()
- func (s *Service) StartSocket()
- func (s *Service) StartTasks()
- func (s *Service) StartWS()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
func NewContext ¶
func NewContext() *Context
type ErrorResponse ¶
type ErrorResponse map[string]interface{}
type Handler ¶
type Handler map[string]HandlerElement
type HandlerElement ¶
type HandlerElement struct { Name string Description string Function HandlerFunc Middlewares []Middleware }
type HandlerFunc ¶
type JsonRequestType ¶
type Middleware ¶
type Middleware func(next HandlerFunc, data interface{}, metadata interface{}) (interface{}, int, error)
type Service ¶
type Service struct { Name string Context *Context Handlers Handler Tasks []func() InitTask func() Logger *zap.Logger Middlewares []Middleware }
func NewService ¶
func (*Service) RegisterConfig ¶
func (*Service) RegisterHandlers ¶
func (*Service) RegisterInitTask ¶
func (s *Service) RegisterInitTask(initTask func())
func (*Service) RegisterMiddlewares ¶
func (s *Service) RegisterMiddlewares(middlewares []Middleware)
func (*Service) RegisterTasks ¶
func (s *Service) RegisterTasks(tasks []func())
func (*Service) StartServices ¶
func (s *Service) StartServices()
func (*Service) StartSocket ¶
func (s *Service) StartSocket()
func (*Service) StartTasks ¶
func (s *Service) StartTasks()
Click to show internal directories.
Click to hide internal directories.