Documentation ¶
Index ¶
- Variables
- func NewWebHookHandler(actor *xbus.Actor) xbus.ActorService
- func SetupCredentials(options nats.Options, r *http.Request) (nats.Options, error)
- type Credentials
- type Gateway
- 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 Header
- type WebHookHandler
- type WebHookPayloadType
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrStopIteration = errors.New("stop iteration") ErrNoSuchInput = errors.New("no such input") )
View Source
var ErrInvalidWebHookPayloadType = errors.New("invalid webhook payload type")
View Source
var ErrNoAPIKey = errors.New("No API key found in the request")
ErrNoAPIKey is when no API key is in the request
View Source
var ErrNotNow = errors.New("The actor is not ready, try again later")
ErrNotNow ...
View Source
var ErrTemporaryError = errors.New(
"An error occurred that should not put the process in fail state")
ErrTemporaryError ...
Functions ¶
func NewWebHookHandler ¶
func NewWebHookHandler(actor *xbus.Actor) xbus.ActorService
NewWebHookHandler ...
Types ¶
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) 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
type WebHookPayloadType ¶
type WebHookPayloadType string
const ( // WebHookServiceName is the name of the webhook service in the registry WebHookServiceName = "http.webhook" WebHookPayloadFullRequest WebHookPayloadType = "full-request" WebHookPayloadEnvelope WebHookPayloadType = "envelope" WebHookPayloadMessageInRequest WebHookPayloadType = "message-in-request" WebHookPayloadMessageInEnvelope WebHookPayloadType = "message-in-envelope" WebHookPayloadMessageContent WebHookPayloadType = "message-content" )
func WebHookPayloadTypeFromString ¶
func WebHookPayloadTypeFromString(s string) (WebHookPayloadType, error)
Click to show internal directories.
Click to hide internal directories.