capability

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: May 19, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CapabilityBackendPluginID = "opni.backends.Capability"
	ServiceID                 = "capability.Backend"
)

Variables

View Source
var Backend_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "capability.Backend",
	HandlerType: (*BackendServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Info",
			Handler:    _Backend_Info_Handler,
		},
		{
			MethodName: "CanInstall",
			Handler:    _Backend_CanInstall_Handler,
		},
		{
			MethodName: "Install",
			Handler:    _Backend_Install_Handler,
		},
		{
			MethodName: "Uninstall",
			Handler:    _Backend_Uninstall_Handler,
		},
		{
			MethodName: "InstallerTemplate",
			Handler:    _Backend_InstallerTemplate_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "pkg/plugins/apis/capability/capability.proto",
}

Backend_ServiceDesc is the grpc.ServiceDesc for Backend service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_pkg_plugins_apis_capability_capability_proto protoreflect.FileDescriptor

Functions

func NewPlugin

func NewPlugin(capabilityName string, backend Backend) plugin.Plugin

func RegisterBackendServer

func RegisterBackendServer(s grpc.ServiceRegistrar, srv BackendServer)

Types

type Backend

type Backend interface {
	// Returns an error if installing the capability would fail.
	CanInstall() error
	// Any error returned from this method is fatal.
	Install(cluster *core.Reference) error
	// Returns a go template string which will generate a shell command used to
	// install the capability. This will be displayed to the user in the UI.
	// See InstallerTemplateSpec above for the available template fields.
	InstallerTemplate() string
	// Should clean up any resources created by capability
	// Errors are handled gracefully
	Uninstall(cluster *core.Reference) error
}

type BackendClient

type BackendClient interface {
	Info(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*InfoResponse, error)
	CanInstall(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
	Install(ctx context.Context, in *InstallRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	Uninstall(ctx context.Context, in *UninstallRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	InstallerTemplate(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*InstallerTemplateResponse, error)
}

BackendClient is the client API for Backend service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewBackendClient

func NewBackendClient(cc grpc.ClientConnInterface) BackendClient

type BackendServer

type BackendServer interface {
	Info(context.Context, *emptypb.Empty) (*InfoResponse, error)
	CanInstall(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
	Install(context.Context, *InstallRequest) (*emptypb.Empty, error)
	Uninstall(context.Context, *UninstallRequest) (*emptypb.Empty, error)
	InstallerTemplate(context.Context, *emptypb.Empty) (*InstallerTemplateResponse, error)
	// contains filtered or unexported methods
}

BackendServer is the server API for Backend service. All implementations must embed UnimplementedBackendServer for forward compatibility

type InfoResponse

type InfoResponse struct {
	CapabilityName string `protobuf:"bytes,1,opt,name=capabilityName,proto3" json:"capabilityName,omitempty"`
	// contains filtered or unexported fields
}

func (*InfoResponse) Descriptor deprecated

func (*InfoResponse) Descriptor() ([]byte, []int)

Deprecated: Use InfoResponse.ProtoReflect.Descriptor instead.

func (*InfoResponse) GetCapabilityName

func (x *InfoResponse) GetCapabilityName() string

func (*InfoResponse) ProtoMessage

func (*InfoResponse) ProtoMessage()

func (*InfoResponse) ProtoReflect

func (x *InfoResponse) ProtoReflect() protoreflect.Message

func (*InfoResponse) Reset

func (x *InfoResponse) Reset()

func (*InfoResponse) String

func (x *InfoResponse) String() string

type InstallRequest

type InstallRequest struct {
	Cluster *core.Reference `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"`
	// contains filtered or unexported fields
}

func (*InstallRequest) Descriptor deprecated

func (*InstallRequest) Descriptor() ([]byte, []int)

Deprecated: Use InstallRequest.ProtoReflect.Descriptor instead.

func (*InstallRequest) GetCluster

func (x *InstallRequest) GetCluster() *core.Reference

func (*InstallRequest) ProtoMessage

func (*InstallRequest) ProtoMessage()

func (*InstallRequest) ProtoReflect

func (x *InstallRequest) ProtoReflect() protoreflect.Message

func (*InstallRequest) Reset

func (x *InstallRequest) Reset()

func (*InstallRequest) String

func (x *InstallRequest) String() string

type InstallerTemplateResponse

type InstallerTemplateResponse struct {
	Template string `protobuf:"bytes,1,opt,name=template,proto3" json:"template,omitempty"`
	// contains filtered or unexported fields
}

func (*InstallerTemplateResponse) Descriptor deprecated

func (*InstallerTemplateResponse) Descriptor() ([]byte, []int)

Deprecated: Use InstallerTemplateResponse.ProtoReflect.Descriptor instead.

func (*InstallerTemplateResponse) GetTemplate

func (x *InstallerTemplateResponse) GetTemplate() string

func (*InstallerTemplateResponse) ProtoMessage

func (*InstallerTemplateResponse) ProtoMessage()

func (*InstallerTemplateResponse) ProtoReflect

func (*InstallerTemplateResponse) Reset

func (x *InstallerTemplateResponse) Reset()

func (*InstallerTemplateResponse) String

func (x *InstallerTemplateResponse) String() string

type UnimplementedBackendServer

type UnimplementedBackendServer struct {
}

UnimplementedBackendServer must be embedded to have forward compatible implementations.

func (UnimplementedBackendServer) CanInstall

func (UnimplementedBackendServer) Info

func (UnimplementedBackendServer) Install

func (UnimplementedBackendServer) InstallerTemplate

func (UnimplementedBackendServer) Uninstall

type UninstallRequest added in v0.4.2

type UninstallRequest struct {
	Cluster *core.Reference `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"`
	// contains filtered or unexported fields
}

func (*UninstallRequest) Descriptor deprecated added in v0.4.2

func (*UninstallRequest) Descriptor() ([]byte, []int)

Deprecated: Use UninstallRequest.ProtoReflect.Descriptor instead.

func (*UninstallRequest) GetCluster added in v0.4.2

func (x *UninstallRequest) GetCluster() *core.Reference

func (*UninstallRequest) ProtoMessage added in v0.4.2

func (*UninstallRequest) ProtoMessage()

func (*UninstallRequest) ProtoReflect added in v0.4.2

func (x *UninstallRequest) ProtoReflect() protoreflect.Message

func (*UninstallRequest) Reset added in v0.4.2

func (x *UninstallRequest) Reset()

func (*UninstallRequest) String added in v0.4.2

func (x *UninstallRequest) String() string

type UnsafeBackendServer

type UnsafeBackendServer interface {
	// contains filtered or unexported methods
}

UnsafeBackendServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to BackendServer will result in compilation errors.

Jump to

Keyboard shortcuts

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