Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) AddConnection(pluginID string, connection types.Connection) error
- func (c *Client) Create(pluginID, connectionID, key string, input rt.CreateInput) (*rt.CreateResult, error)
- func (c *Client) Delete(pluginID, connectionID, key string, input rt.DeleteInput) (*rt.DeleteResult, error)
- func (c *Client) Find(pluginID, connectionID, key string, input rt.FindInput) (*rt.FindResult, error)
- func (c *Client) Get(pluginID, connectionID, key string, input rt.GetInput) (*rt.GetResult, error)
- func (c *Client) GetConnection(pluginID, connectionID string) (types.Connection, error)
- func (c *Client) GetConnectionNamespaces(pluginID, connectionID string) ([]string, error)
- func (c *Client) GetDefaultLayout(pluginID string) ([]rt.LayoutItem, error)
- func (c *Client) GetLayout(pluginID string, layoutID string) ([]rt.LayoutItem, error)
- func (c *Client) GetResourceDefinition(pluginID, typeID string) (rt.ResourceDefinition, error)
- func (c *Client) GetResourceGroup(pluginID, groupID string) (rt.ResourceGroup, error)
- func (c *Client) GetResourceGroups(pluginID, connectionID string) map[string]rt.ResourceGroup
- func (c *Client) GetResourceType(pluginID, typeID string) (*rt.ResourceMeta, error)
- func (c *Client) GetResourceTypes(pluginID, connectionID string) map[string]rt.ResourceMeta
- func (c *Client) HasResourceType(pluginID, typeID string) bool
- func (c *Client) List(pluginID, connectionID, key string, input rt.ListInput) (*rt.ListResult, error)
- func (c *Client) ListConnections(pluginID string) ([]types.Connection, error)
- func (c *Client) ListPlugins() ([]string, error)
- func (c *Client) LoadConnections(pluginID string) ([]types.Connection, error)
- func (c *Client) RemoveConnection(pluginID, connectionID string) error
- func (c *Client) SetLayout(pluginID string, layoutID string, layout []rt.LayoutItem) error
- func (c *Client) StartConnection(pluginID, connectionID string) (types.ConnectionStatus, error)
- func (c *Client) StartConnectionInformer(pluginID, connectionID string) error
- func (c *Client) StopConnection(pluginID, connectionID string) (types.Connection, error)
- func (c *Client) StopConnectionInformer(pluginID, connectionID string) error
- func (c *Client) Update(pluginID, connectionID, key string, input rt.UpdateInput) (*rt.UpdateResult, error)
- func (c *Client) UpdateConnection(pluginID string, connection types.Connection) (types.Connection, error)
- type Controller
- type IClient
Constants ¶
const ( StoreName = "connections" PluginName = "resource" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
I HATE THIS. WHY CAN'T I JUST USE THE SAME INSTANCE?????
func NewClient ¶
func NewClient(controller Controller) *Client
func (*Client) AddConnection ¶
func (c *Client) AddConnection(pluginID string, connection types.Connection) error
func (*Client) Create ¶
func (c *Client) Create( pluginID, connectionID, key string, input rt.CreateInput, ) (*rt.CreateResult, error)
func (*Client) Delete ¶
func (c *Client) Delete( pluginID, connectionID, key string, input rt.DeleteInput, ) (*rt.DeleteResult, error)
func (*Client) GetConnection ¶
func (c *Client) GetConnection(pluginID, connectionID string) (types.Connection, error)
func (*Client) GetConnectionNamespaces ¶
func (*Client) GetDefaultLayout ¶
func (c *Client) GetDefaultLayout(pluginID string) ([]rt.LayoutItem, error)
func (*Client) GetResourceDefinition ¶
func (c *Client) GetResourceDefinition(pluginID, typeID string) (rt.ResourceDefinition, error)
func (*Client) GetResourceGroup ¶
func (c *Client) GetResourceGroup(pluginID, groupID string) (rt.ResourceGroup, error)
func (*Client) GetResourceGroups ¶
func (c *Client) GetResourceGroups(pluginID, connectionID string) map[string]rt.ResourceGroup
func (*Client) GetResourceType ¶
func (c *Client) GetResourceType(pluginID, typeID string) (*rt.ResourceMeta, error)
func (*Client) GetResourceTypes ¶
func (c *Client) GetResourceTypes(pluginID, connectionID string) map[string]rt.ResourceMeta
func (*Client) HasResourceType ¶
func (*Client) ListConnections ¶
func (c *Client) ListConnections(pluginID string) ([]types.Connection, error)
func (*Client) ListPlugins ¶
func (*Client) LoadConnections ¶
func (c *Client) LoadConnections(pluginID string) ([]types.Connection, error)
func (*Client) RemoveConnection ¶
func (*Client) StartConnection ¶
func (c *Client) StartConnection(pluginID, connectionID string) (types.ConnectionStatus, error)
func (*Client) StartConnectionInformer ¶
func (*Client) StopConnection ¶
func (c *Client) StopConnection(pluginID, connectionID string) (types.Connection, error)
func (*Client) StopConnectionInformer ¶
func (*Client) Update ¶
func (c *Client) Update( pluginID, connectionID, key string, input rt.UpdateInput, ) (*rt.UpdateResult, error)
func (*Client) UpdateConnection ¶
func (c *Client) UpdateConnection( pluginID string, connection types.Connection, ) (types.Connection, error)
type Controller ¶
type Controller interface { internaltypes.ConnectedController IClient }
Controller is a controller that manages the lifecycle of resource plugins. Resource plugins interact with a backend that supplies various entities that can be read, created, updated, and deleted.
Has to satisfy both the internal connected controller type, as well as the external client type.
func NewController ¶
func NewController(logger *zap.SugaredLogger, sp pkgsettings.Provider) Controller
NewController returns a new Controller instance.
type IClient ¶
type IClient interface { // ListPlugins returns a list of all the plugins that are registered with the resource controller ListPlugins() ([]string, error) // Get performs a get requests for a resource against a resource backend plugin. // The pluginID should match the name of the plugin in the plugin metadata. Get(pluginID, connectionID, key string, input rt.GetInput) (*rt.GetResult, error) // List performs a list requests for a resource against a resource backend plugin. // The pluginID should match the name of the plugin in the plugin metadata. List(pluginID, connectionID, key string, input rt.ListInput) (*rt.ListResult, error) // Find performs a find requests for a resource against a resource backend plugin. // The pluginID should match the name of the plugin in the plugin metadata. Find(pluginID, connectionID, key string, input rt.FindInput) (*rt.FindResult, error) // Create performs a create requests for a resource against a resource backend plugin. // The pluginID should match the name of the plugin in the plugin metadata. Create(pluginID, connectionID, key string, input rt.CreateInput) (*rt.CreateResult, error) // Update performs a update requests for a resource against a resource backend plugin. // The pluginID should match the name of the plugin in the plugin metadata. Update(pluginID, connectionID, key string, input rt.UpdateInput) (*rt.UpdateResult, error) // Delete performs a delete requests for a resource against a resource backend plugin. // The pluginID should match the name of the plugin in the plugin metadata. Delete(pluginID, connectionID, key string, input rt.DeleteInput) (*rt.DeleteResult, error) // StartConnection starts a connection for a plugin StartConnection(pluginID, connectionID string) (types.ConnectionStatus, error) // StopConnection stops a connection for a plugin StopConnection(pluginID, connectionID string) (types.Connection, error) // LoadConnections loads the connections for the resource provider LoadConnections(pluginID string) ([]types.Connection, error) // ListConnections returns a list of connections for the plugin. // The pluginID should match the name of the plugin in the plugin metadata. ListConnections(pluginID string) ([]types.Connection, error) // GetConnection returns a connection for the plugin. // The pluginID should match the name of the plugin in the plugin metadata. GetConnection(pluginID, connectionID string) (types.Connection, error) // GetConnectionNamespaces returns a list of connection namespaces for a plugin. GetConnectionNamespaces(pluginID, connectionID string) ([]string, error) // AddConnection adds a new connection for the plugin. // The pluginID should match the name of the plugin in the plugin metadata. AddConnection(pluginID string, connection types.Connection) error // UpdateConnection updates an existing connection for a plugin // The pluginID should match the name of the plugin in the plugin metadata. UpdateConnection(pluginID string, connection types.Connection) (types.Connection, error) // RemoveConnection removes a connection for a plugin // The pluginID should match the name of the plugin in the plugin metadata. RemoveConnection(pluginID, connectionID string) error // StartConnectionInformer starts an informer for the given connection StartConnectionInformer(pluginID, connectionID string) error // StopConnectionInformer stops an informer for the given connection StopConnectionInformer(pluginID, connectionID string) error // GetResourceGroups GetResourceGroups(pluginID, connectionID string) map[string]rt.ResourceGroup // GetResourceGroup GetResourceGroup(pluginID, groupID string) (rt.ResourceGroup, error) // GetResourceTypes returns a map of all the resource types that are available to the resource controller GetResourceTypes(pluginID, connectionID string) map[string]rt.ResourceMeta // GetResourceType returns the resource type information by it's string representation // For example, "core::v1::Pod" or "ec2::2012-12-01::EC2Instance" GetResourceType(pluginID, typeID string) (*rt.ResourceMeta, error) // HasResourceType checks to see if the resource type exists HasResourceType(pluginID, typeID string) bool // GetResourceDefinition returns the resource definition for a given resource GetResourceDefinition(pluginID, typeID string) (rt.ResourceDefinition, error) // GetLayout returns the layout for the plugin GetLayout(pluginID string, layoutID string) ([]rt.LayoutItem, error) // GetDefaultLayout returns the default layout for the plugin GetDefaultLayout(pluginID string) ([]rt.LayoutItem, error) // SetLayout sets a single layout for a plugin SetLayout(pluginID string, layoutID string, layout []rt.LayoutItem) error }
Client is the system/UI facing client for making resource requests to the resource controller. We don't really want to expose the other methods of the controller to the outside world, so only methods that should exist here are the ones that the UI/other controllers need to interact with.