Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct { // Context is a free key-value dictionary that will be passed to the underlying // service. Context context.Context `json:"-"` // Address is the HTTP address the server is listening to. Address string `json:"address"` // TLS is the TLS settings used to run the TLS server. TLS *tls.Config `json:"-"` // CertFile is the relative path to the certificate file for the TLS server. CertFile string `json:"-"` // KeyFile is the relative path to the key file for the TLS server. KeyFile string `json:"-"` // Middleware is the HTTP middleware chain that will be applied to the HTTP server. Middleware func(http.Handler) http.Handler `json:"-"` // Attach allows you to attach an external HTTP handler to the server. It is // useful for adding HTTP routes with custom routing and business logic. // // If a handler is attached, all routes within this handler will be prefixed with // "/api". Attach http.Handler `json:"-"` }
Options is the options a user can pass to configure the gateway or the scheduler.
type Service ¶
type Service interface { // String returns the string representation of the service. // // Example: "enterprise" String() string // Options returns the options originally passed to the Options struct. This // can be used to validate and override user's options if necessary. Options() *Options // Handler returns a net/http Handler allowing the use of the service as a // standard HTTP handler in an external Go application. Handler(*Toolkit) (http.Handler, error) // ListenAndServe starts the HTTP server. This is the equivalent of the net/http // ListenAndServe. ListenAndServe(*Toolkit, *WithTLS) error // Shutdown gracefully shuts down the server without interrupting any active // connections such as CRON tasks. It is the equivalent of the net/http Shutdown // function. Shutdown(*Toolkit) error }
Service is the interface used to create the gateway and scheduler services.
type Toolkit ¶
type Toolkit struct { // Logger gives access to the logrus Logger passed in options when creating the // Blacksmith application. Logger *logrus.Logger // Sources is the collection of sources registered in the Blacksmith application. Sources map[string]source.Source // Destinations is the collection of destinations registered in the Blacksmith // application. Destinations map[string]destination.Destination // Store is the store adapter registered in the Blacksmith application. Store store.Store // PubSub is the pubsub adapter registered in the Blacksmith application. PubSub pubsub.PubSub // Supervisor is the supervisor adapter registered in the Blacksmith application. Supervisor supervisor.Supervisor }
Toolkit contains a suite of utilities to help the adapter successfully run the service.
Directories ¶
Path | Synopsis |
---|---|
Package gateway provides the development kit for working with incoming events.
|
Package gateway provides the development kit for working with incoming events. |
Package scheduler provides the development kit for working with a scheduler that receives events from the gateway and pubsub packages and, used in tandem with the store package, is in charge of the reliability of the event delivery to destinations.
|
Package scheduler provides the development kit for working with a scheduler that receives events from the gateway and pubsub packages and, used in tandem with the store package, is in charge of the reliability of the event delivery to destinations. |
Click to show internal directories.
Click to hide internal directories.