Documentation ¶
Index ¶
Constants ¶
const DefaultClientTimeout = time.Second
DefaultClientTimeout defines the default http client timeout to use, if it is not supplied in the config
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CombinerConfig ¶
type CombinerConfig struct { MultiRouteConfig FanIn FanInConfig `json:"fan_in" required:"true"` }
CombinerConfig is used to parse the configuration for a Combiner
type ComponentConfig ¶
type ComponentConfig struct { ID string `json:"id" required:"true"` Type string `json:"type" required:"true"` }
ComponentConfig is used to parse the base properties for a component
type Config ¶
type Config interface {
// contains filtered or unexported methods
}
Config is the base interface to initialise a network from a config file
type Duration ¶
Duration is an alias for time.Duration (required since time.Duration Unmarshal is not defined)
func (Duration) MarshalJSON ¶
MarshalJSON converts the Duration object the byte representation of its human-readable format
func (*Duration) UnmarshalJSON ¶
UnmarshalJSON converts the byte representation of the Duration object into time.Duration
type FanInConfig ¶
type FanInConfig struct { Type string `json:"type" required:"true"` Properties json.RawMessage `json:"properties" yaml:"properties,omitempty"` }
FanInConfig is used to parse the configuration for a FanIn
type GrpcConfig ¶ added in v0.2.0
type GrpcConfig struct {
ServiceMethod string `json:"service_method,omitempty"`
}
type MultiRouteConfig ¶
type MultiRouteConfig struct { ComponentConfig Routes Routes `json:"routes" required:"true"` }
MultiRouteConfig is used to parse the configuration for a MultiRouteComponent
type ProxyConfig ¶
type ProxyConfig struct { ComponentConfig Endpoint string `json:"endpoint" required:"true"` Timeout Duration `json:"timeout"` Protocol protocol.Protocol `json:"protocol"` GrpcConfig }
ProxyConfig is used to parse the configuration for a Proxy
type RouterConfig ¶
type RouterConfig struct { MultiRouteConfig Strategy StrategyConfig `json:"strategy" required:"true"` }
RouterConfig is used to parse the configuration for a Router
type Routes ¶
type Routes []Config
Routes represent a collection of configurations.
func (Routes) Routes ¶
Routes takes in an object of type Routes and returns a map of each route's ID and the route
func (Routes) UnmarshalJSON ¶
UnmarshalJSON is used to parse a given input byte array to config objects
type StrategyConfig ¶
type StrategyConfig struct { Type string `json:"type" required:"true"` Properties json.RawMessage `json:"properties" yaml:"properties,omitempty"` }
StrategyConfig is used to parse the configuration for a RoutingStrategy
func (*StrategyConfig) Strategy ¶
func (c *StrategyConfig) Strategy() (fiber.RoutingStrategy, error)
Strategy takes a reference to a StrategyConfig and creates a RoutingStrategy