Documentation ¶
Index ¶
- Variables
- func GetEngineID(ctx *handler.Context) (engine.ID, error)
- func NewCloseHandler(es service.EngineService, logger logger.Logger) handler.Handler
- func NewConnectHandler(es service.EngineService, logger logger.Logger) handler.Handler
- func NewInitHandler(es service.EngineService, config *config.Config, logger logger.Logger) handler.Handler
- func NewOKHandler() handler.Handler
- func NewStartHandler(es service.EngineService, logger logger.Logger) handler.Handler
- func NewStopHandler(es service.EngineService, logger logger.Logger) handler.Handler
- func WithEngineID(ctx *handler.Context, block func(engine.ID) error) error
- type CloseHandler
- type ConnectHandler
- type InitHandler
- type OKHandler
- type StartHandler
- type StopHandler
Constants ¶
This section is empty.
Variables ¶
var QueryKeys = struct { EngineID, EngineIDAlias string }{ EngineID: "engine", EngineIDAlias: "key", }
QueryKeys is a set of uri query keys.
Functions ¶
func GetEngineID ¶
GetEngineID gets the engine.ID from the uri query and returns it, otherwise returns BAD_REQUEST error.
func NewCloseHandler ¶
func NewConnectHandler ¶
func NewInitHandler ¶
func NewOKHandler ¶
func NewStartHandler ¶
func NewStopHandler ¶
Types ¶
type CloseHandler ¶
type CloseHandler struct {
// contains filtered or unexported fields
}
CloseHandler is a handler to close the engine connection. When the engine state is
- NotConnected, then returns NOT_FOUND or BAD_REQUEST
- Connected, StandBy or Thinking, then closes connection and returns OK
See domain/entity/engine/state.go about engine state.
func (*CloseHandler) Description ¶
func (*CloseHandler) Description() string
func (*CloseHandler) Methods ¶
func (*CloseHandler) Methods() []string
type ConnectHandler ¶
type ConnectHandler struct {
// contains filtered or unexported fields
}
ConnectHandler is a handler for connecting (initializing) to the engine. When the engine state is Connected, StandBy or Thinking, then returns BAD_REQUEST See domain/entity/engine/state.go about engine state.
func (*ConnectHandler) Description ¶
func (*ConnectHandler) Description() string
func (*ConnectHandler) Methods ¶
func (*ConnectHandler) Methods() []string
type InitHandler ¶
type InitHandler struct {
// contains filtered or unexported fields
}
InitHandler is a handler that initializes all engine. It closes all engines and returns the list of engine names.
func (*InitHandler) Description ¶
func (*InitHandler) Description() string
func (*InitHandler) Methods ¶
func (*InitHandler) Methods() []string
type OKHandler ¶
type OKHandler struct{}
OKHandler is a handler that just says OK.
func (*OKHandler) Description ¶
type StartHandler ¶
type StartHandler struct {
// contains filtered or unexported fields
}
StartHandler is a handler for starting the engine think. When the engine state is
- NotConnected, then returns NOT_FOUND or BAD_REQUEST
- Connected or StandBy, then starts thinking and returns OK
- Thinking, then returns OK (do nothing)
See domain/entity/engine/state.go about engine state.
func (*StartHandler) Description ¶
func (*StartHandler) Description() string
func (*StartHandler) Methods ¶
func (*StartHandler) Methods() []string
type StopHandler ¶
type StopHandler struct {
// contains filtered or unexported fields
}
StopHandler is a handler for stopping the engine think. When the engine state is
- NotConnected, then returns NOT_FOUND or BAD_REQUEST
- Connected or StandBy, then returns OK (do nothing)
- Thinking, then stops thinking and returns OK
See domain/entity/engine/state.go about engine state.
func (*StopHandler) Description ¶
func (*StopHandler) Description() string
func (*StopHandler) Methods ¶
func (*StopHandler) Methods() []string