Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrUnknownTransport means a TransportFactory is missing for a transport. ErrUnknownTransport = errors.New("unknown transport") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config is the postdog configuration.
func (*Config) Dog ¶
Dog instantiates the *postdog.Dog from the parsed configuration.
For every distinct `transport.use` config value a TransportFactory must be provided. It will return ErrUnknownTransport if a TransportFactory is missing.
type Option ¶
type Option func(*Config)
Option is an option for the (*Config).Dog() method.
func WithOptions ¶ added in v0.9.6
WithOptions returns an Option that adds postdog.Options to the postdog.Dog returned by cfg.Dog().
func WithTransportFactory ¶
func WithTransportFactory(use string, factory TransportFactory) Option
WithTransportFactory returns an Option that specifies the TransportFactory for a `transport.use` value.
type TransportFactory ¶
type TransportFactory interface {
Transport(context.Context, map[string]interface{}) (postdog.Transport, error)
}
A TransportFactory accepts the transport-specific configuration and instantiates a transport from that configuration.
type TransportFactoryFunc ¶ added in v0.9.5
TransportFactoryFunc allows functions to be used as TransportFactories.