Documentation
¶
Index ¶
- Constants
- func Load(ctx context.Context, source settings.Source, c *Component) (http.RoundTripper, error)
- func New(ctx context.Context, source settings.Source) (http.RoundTripper, error)
- type Component
- type Config
- type DefaultComponent
- type DefaultConfig
- type RoundTripper
- type SmartComponent
- type SmartConfig
Constants ¶
const ( // TypeDefault is used to select the default Go HTTP client. TypeDefault = "DEFAULT" // TypeSmart is used to select the transportd HTTP client. TypeSmart = "SMART" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Component ¶
type Component struct {
Default *DefaultComponent
Smart *SmartComponent
}
Component is the top level HTTP client component.
func NewComponent ¶
func NewComponent() *Component
NewComponent populates an HTTPComponent with defaults.
type Config ¶
type Config struct {
Type string `description:"The type of HTTP client. Choices are SMART and DEFAULT."`
Default *DefaultConfig
Smart *SmartConfig
}
Config wraps all HTTP related settings.
type DefaultComponent ¶
type DefaultComponent struct{}
DefaultComponent is a component for creating the default Go HTTP client.
func (*DefaultComponent) New ¶
func (*DefaultComponent) New(ctx context.Context, conf *DefaultConfig) (http.RoundTripper, error)
New constructs a client from the given configuration
func (*DefaultComponent) Settings ¶
func (*DefaultComponent) Settings() *DefaultConfig
Settings returns the default configuration.
type DefaultConfig ¶
type DefaultConfig struct {
ContentType string
}
DefaultConfig contains all settings for the default Go HTTP client.
type RoundTripper ¶
type RoundTripper = http.RoundTripper
RoundTripper is the interface that handles all HTTP operations. It is almost exclusively used with an http.Client wrapped around it. This is included here for documentation purposes only.
type SmartComponent ¶
type SmartComponent struct {
Plugins []transportd.NewComponent
}
SmartComponent is a component for creating a transportd HTTP client.
func (*SmartComponent) New ¶
func (c *SmartComponent) New(ctx context.Context, conf *SmartConfig) (http.RoundTripper, error)
New constructs a client from the given configuration.
func (*SmartComponent) Settings ¶
func (*SmartComponent) Settings() *SmartConfig
Settings returns the default configuration.
type SmartConfig ¶
type SmartConfig struct {
OpenAPI string `description:"The full OpenAPI specification with transportd extensions."`
}
SmartConfig contains all settings for the transportd HTTP client.