Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory provides a mechanism for building various type of proxy based on their unique type key. This is primarily developed for use when serialising proxy connection information to and from yaml files for Juju.
func NewDefaultFactory ¶
NewDefaultFactory constructs a factory with all the known proxy implementations in juju registered.
func (*Factory) MakerForTypeKey ¶
func (f *Factory) MakerForTypeKey(typeKey string) (*FactoryMaker, error)
MakerForTypeKey provides a new factory maker for the given type key if one has been registered.
func (*Factory) ProxierFromConfig ¶
func (f *Factory) ProxierFromConfig(typeKey string, config map[string]interface{}) (proxy.Proxier, error)
ProxierFromConfig is a utility function for making a proxier from this factory using raw config data within in a map[string]interface{}. The type key cannot be an empty string.
type FactoryMaker ¶
type FactoryMaker struct { RawConfig interface{} Register FactoryRegister }
FactoryMaker is shell object used for facilitating the making of a proxy object
func (*FactoryMaker) Config ¶
func (f *FactoryMaker) Config() interface{}
Config returns a raw config for a given proxy type that can be used to unmarshal against.
type FactoryRegister ¶
type FactoryRegister struct { ConfigFn func() interface{} MakerFn func(interface{}) (proxy.Proxier, error) }
FactoryRegister describe registration details for building a new proxy.