Documentation ¶
Index ¶
- func ToHttpErrorCode(errorCode ErrorCode) int
- func ToJsonRPCErrorCode(errorCode ErrorCode) int
- func ValidatedGatewaySpec(tomlString string) (job.Job, error)
- type ConnectionManager
- type ConnectionManagerConfig
- type DONConfig
- type DONConnectionManager
- type Delegate
- func (d *Delegate) AfterJobCreated(spec job.Job)
- func (d *Delegate) BeforeJobCreated(spec job.Job)
- func (d *Delegate) BeforeJobDeleted(spec job.Job)
- func (d *Delegate) JobType() job.Type
- func (d *Delegate) OnDeleteJob(spec job.Job, q pg.Queryer) error
- func (d *Delegate) ServicesForSpec(spec job.Job) (services []job.ServiceCtx, err error)
- type ErrorCode
- type Gateway
- type GatewayConfig
- type Handler
- type HandlerType
- type NodeConfig
- type UserCallbackPayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToHttpErrorCode ¶
func ToJsonRPCErrorCode ¶
Types ¶
type ConnectionManager ¶
type ConnectionManager interface { job.ServiceCtx network.ConnectionAcceptor DONConnectionManager(donId string) DONConnectionManager }
ConnectionManager holds all connections between Gateway and Nodes.
func NewConnectionManager ¶
func NewConnectionManager(config *GatewayConfig, clock gw_common.Clock, lggr logger.Logger) (ConnectionManager, error)
type ConnectionManagerConfig ¶
type DONConfig ¶
type DONConfig struct { DonId string HandlerName string HandlerConfig json.RawMessage Members []NodeConfig }
type DONConnectionManager ¶
type Delegate ¶ added in v2.3.0
type Delegate struct {
// contains filtered or unexported fields
}
func NewDelegate ¶ added in v2.3.0
func (*Delegate) AfterJobCreated ¶ added in v2.3.0
func (*Delegate) BeforeJobCreated ¶ added in v2.3.0
func (*Delegate) BeforeJobDeleted ¶ added in v2.3.0
func (*Delegate) OnDeleteJob ¶ added in v2.3.0
func (*Delegate) ServicesForSpec ¶ added in v2.3.0
ServicesForSpec returns the scheduler to be used for running observer jobs
type Gateway ¶
type Gateway interface { job.ServiceCtx gw_net.HTTPRequestHandler }
func NewGateway ¶
func NewGateway(codec api.Codec, httpServer gw_net.HttpServer, handlers map[string]Handler, connMgr ConnectionManager, lggr logger.Logger) Gateway
func NewGatewayFromConfig ¶
func NewGatewayFromConfig(config *GatewayConfig, lggr logger.Logger) (Gateway, error)
type GatewayConfig ¶
type GatewayConfig struct { UserServerConfig gw_net.HTTPServerConfig NodeServerConfig gw_net.WebSocketServerConfig ConnectionManagerConfig ConnectionManagerConfig Dons []DONConfig }
type Handler ¶
type Handler interface { job.ServiceCtx // Each user request is processed by a separate goroutine, which: // 1. calls HandleUserMessage // 2. waits on callbackCh with a timeout HandleUserMessage(ctx context.Context, msg *api.Message, callbackCh chan<- UserCallbackPayload) error // Handlers should not make any assumptions about goroutines calling HandleNodeMessage HandleNodeMessage(ctx context.Context, msg *api.Message, nodeAddr string) error }
func NewDummyHandler ¶
func NewDummyHandler(donConfig *DONConfig, connMgr DONConnectionManager) (Handler, error)
func NewHandler ¶
func NewHandler(handlerType HandlerType, donConfig *DONConfig, connMgr DONConnectionManager) (Handler, error)
type NodeConfig ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.