Documentation ¶
Index ¶
- Constants
- Variables
- func NewWebHookHandler(actor *xbus.Actor) xbus.ActorService
- func SetupCredentials(options nats.Options, r *http.Request) (nats.Options, error)
- type Beta11Envelope
- type Credentials
- type Gateway
- func (g *Gateway) Beta11InputHandler(w http.ResponseWriter, r *http.Request)
- func (g *Gateway) Beta11OutputHandler(w http.ResponseWriter, r *http.Request)
- func (g *Gateway) OutputHandler(w http.ResponseWriter, r *http.Request)
- func (g *Gateway) ProcessRequestHandler(w http.ResponseWriter, r *http.Request)
- func (g *Gateway) ProcessingEndHandler(w http.ResponseWriter, r *http.Request)
- func (g *Gateway) RequestHandler(w http.ResponseWriter, r *http.Request)
- func (g *Gateway) Shutdown()
- func (g *Gateway) Startup() error
- type WebHookHandler
Constants ¶
const (
// WebHookServiceName is the name of the webhook service in the registry
WebHookServiceName = "http.webhook"
)
Variables ¶
var ErrNoAPIKey = errors.New("No API key found in the request")
ErrNoAPIKey is when no API key is in the request
var ErrNotNow = errors.New("The actor is not ready, try again later")
ErrNotNow ...
var ErrTemporaryError = errors.New(
"An error occured that should not put the process in fail state")
ErrTemporaryError ...
Functions ¶
func NewWebHookHandler ¶
func NewWebHookHandler(actor *xbus.Actor) xbus.ActorService
NewWebHookHandler ...
Types ¶
type Beta11Envelope ¶
type Beta11Envelope struct { api.Envelope Context *api.ProcessingContext `json:"context"` }
Beta11Envelope is a envelope structure from the beta11 version
type Credentials ¶
Credentials holds user credentials extracted from the request
func ExtractCredentials ¶
func ExtractCredentials(r *http.Request) (*Credentials, error)
ExtractCredentials extracts authentication information from a http.Request
type Gateway ¶
type Gateway struct { XbusOptions xbus.COptions Log xbus.Logger Router *mux.Router // contains filtered or unexported fields }
Gateway provides a http router that handle a http-rest gateway to xbus
func NewGateway ¶
NewGateway initializes a Gateway
func (*Gateway) Beta11InputHandler ¶
func (g *Gateway) Beta11InputHandler(w http.ResponseWriter, r *http.Request)
Beta11InputHandler is the handler for the deprecated '{actor}/input' route
func (*Gateway) Beta11OutputHandler ¶
func (g *Gateway) Beta11OutputHandler(w http.ResponseWriter, r *http.Request)
Beta11OutputHandler is the handler for the deprecated '{actor}/output/{output}' route
func (*Gateway) OutputHandler ¶
func (g *Gateway) OutputHandler(w http.ResponseWriter, r *http.Request)
OutputHandler is the handler for the '{actor}/output' route
func (*Gateway) ProcessRequestHandler ¶
func (g *Gateway) ProcessRequestHandler(w http.ResponseWriter, r *http.Request)
ProcessRequestHandler is the handler for the '{actor}/processrequest' route
func (*Gateway) ProcessingEndHandler ¶
func (g *Gateway) ProcessingEndHandler(w http.ResponseWriter, r *http.Request)
ProcessingEndHandler is the handler for the '{actor}/processingend' route
func (*Gateway) RequestHandler ¶
func (g *Gateway) RequestHandler(w http.ResponseWriter, r *http.Request)
RequestHandler is the handler for the '{actor}/request' route
type WebHookHandler ¶
type WebHookHandler struct {
// contains filtered or unexported fields
}
WebHookHandler ...
func (*WebHookHandler) Process ¶
func (wh *WebHookHandler) Process(apc *xbus.ActorProcessingContext) error
Process a request