package
0.5.1
Repository: https://github.com/xmidt-org/arrange.git
Documentation: pkg.go.dev

# Functions

ApplyMiddleware handles decorating a target type T.
ApplyOptions applies several options to a target.
AsOption converts a closure into an Option for a given target type.
BaseContext returns a server option that sets or replaces the http.Server.BaseContext function.
ClientMiddleware returns a ClientOption that applies the given middleware to the Transport (http.RoundTripper).
ConnContext returns a server option that sets or augments the http.Server.ConnContext function.
ConnState returns a server option that sets or replaces the http.Server.ConnState function.
ErrorLog returns a server option that sets or replaces the http.Server.ErrorLog.
InvalidOption returns an Option that returns the given error.
NewClient is the primary client constructor for arrange.
NewClientCustom is an *http.Client constructor that allows customization of the concrete ClientFactory used to create the *http.Client.
NewListener encapsulates the logic for creating a net.Listener for a server.
NewServer is the primary server constructor for arrange.
NewServerCustom is a server constructor that allows a client to customize the concrete ServerFactory and http.Handler for the server.
ProvideClient assembles a client out of application components in a standard, opinionated way.
ProvideClientCustom is like ProvideClient, but it allows customization of the concrete ClientFactory dependency.
ProvideServer assembles a server out of application components in a standard, opinionated way.
ProvideServerCustom is like ProvideServer, but it allows customization of the concrete ServerFactory and http.Handler dependencies.
ServerMiddleware returns an option that applies any number of middleware functions to a server's handler.

# Constants

ServerAbnormalExitCode is the shutdown exit code, returned by the process, when an *http.Server exits with an error OTHER than ErrServerClosed.

# Variables

ErrClientNameRequired indicates that ProvideClient or ProvideClientCustom was called with an empty client name.
ErrServerNameRequired indicates that ProvideServer or ProvideServerCustom was called with an empty server name.

# Structs

ClientConfig holds unmarshaled client configuration options.
DefaultListenerFactory is the default implementation of ListenerFactory.
ServerConfig is the built-in ServerFactory implementation for this package.
TransportConfig holds the unmarshalable configuration options for building an http.Transport.

# Interfaces

BaseContextFunc is a composable type that is used to build http.Server.BaseContext functions.
ClientFactory is the interface implemented by unmarshaled configuration objects that produces an http.Client.
ConnContextFunc is the type of function required by net/http.Server.ConnContext.
ListenerFactory is a strategy for creating net.Listener instances.
Middleware is the underlying type for decorators.
Option represents something that can modify a target object.
OptionClosure represents the closure types that are convertible into Option objects.
ServerFactory is the strategy for instantiating an *http.Server and an associated net.Listener.

# Type aliases

ListenerMiddleware represents a strategy for decorating net.Listener instances.
OptionFunc is a closure type that can act as an Option.
Options is an aggregate Option that allows several options to be grouped together.