plugin

package
v0.0.0-...-6dcdff4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2024 License: AGPL-3.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoConnection = errors.New("no connection provided")

Functions

This section is empty.

Types

type ResourcePlugin

type ResourcePlugin struct {
	plugin.Plugin
	// Concrete implementation, written in Go. This is only used for plugins
	// that are written in Go.
	Impl types.ResourceProvider
}

This is the implementation of plugin.Plugin so we can serve/consume this.

func (*ResourcePlugin) GRPCClient

func (p *ResourcePlugin) GRPCClient(
	_ context.Context,
	_ *plugin.GRPCBroker,
	c *grpc.ClientConn,
) (interface{}, error)

func (*ResourcePlugin) GRPCServer

func (p *ResourcePlugin) GRPCServer(_ *plugin.GRPCBroker, s *grpc.Server) error

type ResourcePluginClient

type ResourcePluginClient struct {
	// contains filtered or unexported fields
}

ResourcePluginClient is the real client implementation for ResourcePlugin.

func (*ResourcePluginClient) Create

func (*ResourcePluginClient) Delete

func (*ResourcePluginClient) DeleteConnection

func (r *ResourcePluginClient) DeleteConnection(
	ctx *pkgtypes.PluginContext,
	id string,
) error

func (*ResourcePluginClient) Find

func (*ResourcePluginClient) Get

func (*ResourcePluginClient) GetConnection

func (r *ResourcePluginClient) GetConnection(
	ctx *pkgtypes.PluginContext,
	id string,
) (pkgtypes.Connection, error)

func (*ResourcePluginClient) GetConnectionNamespaces

func (r *ResourcePluginClient) GetConnectionNamespaces(
	ctx *pkgtypes.PluginContext,
	id string,
) ([]string, error)

func (*ResourcePluginClient) GetDefaultLayout

func (r *ResourcePluginClient) GetDefaultLayout() ([]types.LayoutItem, error)

func (*ResourcePluginClient) GetLayout

func (r *ResourcePluginClient) GetLayout(layoutID string) ([]types.LayoutItem, error)

func (*ResourcePluginClient) GetResourceDefinition

func (r *ResourcePluginClient) GetResourceDefinition(id string) (types.ResourceDefinition, error)

func (*ResourcePluginClient) GetResourceGroup

func (r *ResourcePluginClient) GetResourceGroup(id string) (types.ResourceGroup, error)

func (*ResourcePluginClient) GetResourceGroups

func (r *ResourcePluginClient) GetResourceGroups(connID string) map[string]types.ResourceGroup

func (*ResourcePluginClient) GetResourceType

func (r *ResourcePluginClient) GetResourceType(id string) (*types.ResourceMeta, error)

func (*ResourcePluginClient) GetResourceTypes

func (r *ResourcePluginClient) GetResourceTypes(connID string) map[string]types.ResourceMeta

func (*ResourcePluginClient) HasInformer

func (r *ResourcePluginClient) HasInformer(
	_ *pkgtypes.PluginContext,
	connectionID string,
) bool

func (*ResourcePluginClient) HasResourceType

func (r *ResourcePluginClient) HasResourceType(id string) bool

func (*ResourcePluginClient) List

func (*ResourcePluginClient) ListConnections

func (r *ResourcePluginClient) ListConnections(
	ctx *pkgtypes.PluginContext,
) ([]pkgtypes.Connection, error)

func (*ResourcePluginClient) ListenForEvents

func (r *ResourcePluginClient) ListenForEvents(
	ctx *pkgtypes.PluginContext,
	addStream chan types.InformerAddPayload,
	updateStream chan types.InformerUpdatePayload,
	deleteStream chan types.InformerDeletePayload,
) error

ListenForEvents listens for events from the resource provider and pipes them back to the event subsystem, stopping when stopCh is closed. This method is blocking, and should be run as part of the resourcer controller's event loop.

func (*ResourcePluginClient) LoadConnections

func (r *ResourcePluginClient) LoadConnections(
	ctx *pkgtypes.PluginContext,
) ([]pkgtypes.Connection, error)

func (*ResourcePluginClient) SetLayout

func (r *ResourcePluginClient) SetLayout(_ string, _ []types.LayoutItem) error

func (*ResourcePluginClient) StartConnection

func (r *ResourcePluginClient) StartConnection(
	ctx *pkgtypes.PluginContext,
	connectionID string,
) (pkgtypes.ConnectionStatus, error)

func (*ResourcePluginClient) StartConnectionInformer

func (r *ResourcePluginClient) StartConnectionInformer(
	ctx *pkgtypes.PluginContext,
	connectionID string,
) error

func (*ResourcePluginClient) StopConnection

func (r *ResourcePluginClient) StopConnection(
	ctx *pkgtypes.PluginContext,
	connectionID string,
) (pkgtypes.Connection, error)

func (*ResourcePluginClient) StopConnectionInformer

func (r *ResourcePluginClient) StopConnectionInformer(
	ctx *pkgtypes.PluginContext,
	connectionID string,
) error

func (*ResourcePluginClient) Update

func (*ResourcePluginClient) UpdateConnection

type ResourcePluginServer

type ResourcePluginServer struct {
	// This is the real implementation
	Impl types.ResourceProvider
}

Here is the gRPC server that GRPCClient talks to.

func (*ResourcePluginServer) Create

func (*ResourcePluginServer) Delete

func (*ResourcePluginServer) DeleteConnection

func (s *ResourcePluginServer) DeleteConnection(
	ctx context.Context,
	in *proto.ConnectionRequest,
) (*emptypb.Empty, error)

func (*ResourcePluginServer) Find

func (*ResourcePluginServer) Get

func (*ResourcePluginServer) GetConnection

func (*ResourcePluginServer) GetConnectionNamespaces

func (*ResourcePluginServer) GetDefaultLayout

func (s *ResourcePluginServer) GetDefaultLayout(
	_ context.Context,
	_ *emptypb.Empty,
) (*proto.Layout, error)

func (*ResourcePluginServer) GetLayout

func (*ResourcePluginServer) GetResourceDefinition

func (*ResourcePluginServer) GetResourceGroup

func (*ResourcePluginServer) GetResourceGroups

func (*ResourcePluginServer) GetResourceType

func (*ResourcePluginServer) GetResourceTypes

func (*ResourcePluginServer) HasInformer

func (*ResourcePluginServer) HasResourceType

func (*ResourcePluginServer) List

func (*ResourcePluginServer) ListConnections

func (s *ResourcePluginServer) ListConnections(
	ctx context.Context,
	_ *emptypb.Empty,
) (*proto.ConnectionList, error)

func (*ResourcePluginServer) ListenForEvents

Namespaceless and connectionless.

func (*ResourcePluginServer) LoadConnections

func (s *ResourcePluginServer) LoadConnections(
	ctx context.Context,
	_ *emptypb.Empty,
) (*proto.ConnectionList, error)

func (*ResourcePluginServer) SetLayout

func (*ResourcePluginServer) StartConnection

func (*ResourcePluginServer) StartConnectionInformer

func (s *ResourcePluginServer) StartConnectionInformer(
	ctx context.Context,
	in *proto.StartConnectionInformerRequest,
) (*emptypb.Empty, error)

func (*ResourcePluginServer) StopConnection

func (s *ResourcePluginServer) StopConnection(
	ctx context.Context,
	in *proto.ConnectionRequest,
) (*proto.Connection, error)

func (*ResourcePluginServer) StopConnectionInformer

func (s *ResourcePluginServer) StopConnectionInformer(
	ctx context.Context,
	in *proto.StopConnectionInformerRequest,
) (*emptypb.Empty, error)

func (*ResourcePluginServer) Update

func (*ResourcePluginServer) UpdateConnection

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL