Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrProviderNotFound = errors.New("the specified provider can't be found")
ErrProviderNotFound is an error which is used when we try to create a new client for a given provider which isn't registered with the factory.
Functions ¶
This section is empty.
Types ¶
type FactoryFunc ¶
type FactoryFunc func(kubernetes.Interface, v1alpha1.NamespacedProvider) (Interface, error)
FactoryFunc is the interface used to allow creating a new provider. This shoud be used by provider wrappers to allow for creating new clients.
type FactoryInterface ¶
type FactoryInterface interface { Register(string, FactoryFunc) From(v1alpha1.NamespacedProvider) (Interface, error) }
FactoryInterface is the interface used for a ProviderFactory. It allows you to fetch providers from a local store and use them to configure monitors.
type Interface ¶
type Interface interface { Create(v1alpha1.MonitorTemplateSpec) (string, error) Delete(string) error Update(string, v1alpha1.MonitorTemplateSpec) (string, error) }
Interface reflects interface we'll use to speak with Monitoring Providers.
type SimpleFactory ¶
type SimpleFactory struct {
// contains filtered or unexported fields
}
SimpleFactory is a factory object that knows how to get providers.
func NewFactory ¶
func NewFactory(client kubernetes.Interface) *SimpleFactory
NewFactory returns a new SimpleFactory which is able to register a set of Providers and create clients for them.
func (*SimpleFactory) From ¶
func (pf *SimpleFactory) From(prov v1alpha1.NamespacedProvider) (Interface, error)
From creates a new provider from the given configuration. This can then be used to register the provider within the
func (*SimpleFactory) Register ¶
func (pf *SimpleFactory) Register(name string, ff FactoryFunc)
Register registers the given provider with the factory under the given name.