Documentation ¶
Index ¶
- Constants
- Variables
- func NewPlugin(capabilityName string, backend Backend) plugin.Plugin
- func RegisterBackendServer(s grpc.ServiceRegistrar, srv BackendServer)
- type Backend
- type BackendClient
- type BackendServer
- type InfoResponse
- type InstallRequest
- type InstallerTemplateResponse
- func (*InstallerTemplateResponse) Descriptor() ([]byte, []int)deprecated
- func (x *InstallerTemplateResponse) GetTemplate() string
- func (*InstallerTemplateResponse) ProtoMessage()
- func (x *InstallerTemplateResponse) ProtoReflect() protoreflect.Message
- func (x *InstallerTemplateResponse) Reset()
- func (x *InstallerTemplateResponse) String() string
- type UnimplementedBackendServer
- func (UnimplementedBackendServer) CanInstall(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
- func (UnimplementedBackendServer) Info(context.Context, *emptypb.Empty) (*InfoResponse, error)
- func (UnimplementedBackendServer) Install(context.Context, *InstallRequest) (*emptypb.Empty, error)
- func (UnimplementedBackendServer) InstallerTemplate(context.Context, *emptypb.Empty) (*InstallerTemplateResponse, error)
- func (UnimplementedBackendServer) Uninstall(context.Context, *UninstallRequest) (*emptypb.Empty, error)
- type UninstallRequest
- type UnsafeBackendServer
Constants ¶
const ( CapabilityBackendPluginID = "opni.backends.Capability" ServiceID = "capability.Backend" )
Variables ¶
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)
var File_pkg_plugins_apis_capability_capability_proto protoreflect.FileDescriptor
Functions ¶
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 *corev1.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 *corev1.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 *v1.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() *v1.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 (x *InstallerTemplateResponse) ProtoReflect() protoreflect.Message
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) Info(context.Context, *emptypb.Empty) (*InfoResponse, error)
func (UnimplementedBackendServer) Install ¶
func (UnimplementedBackendServer) Install(context.Context, *InstallRequest) (*emptypb.Empty, error)
func (UnimplementedBackendServer) InstallerTemplate ¶
func (UnimplementedBackendServer) InstallerTemplate(context.Context, *emptypb.Empty) (*InstallerTemplateResponse, error)
func (UnimplementedBackendServer) Uninstall ¶
func (UnimplementedBackendServer) Uninstall(context.Context, *UninstallRequest) (*emptypb.Empty, error)
type UninstallRequest ¶ added in v0.4.2
type UninstallRequest struct { Cluster *v1.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() *v1.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.