system

package
v0.5.4-rc5 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SystemPluginID  = "opni.System"
	KVServiceID     = "system.KeyValueStore"
	SystemServiceID = "system.System"
)

Variables

View Source
var File_github_com_rancher_opni_pkg_plugins_apis_system_system_proto protoreflect.FileDescriptor
View Source
var KeyValueStore_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "system.KeyValueStore",
	HandlerType: (*KeyValueStoreServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Put",
			Handler:    _KeyValueStore_Put_Handler,
		},
		{
			MethodName: "Get",
			Handler:    _KeyValueStore_Get_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _KeyValueStore_Delete_Handler,
		},
		{
			MethodName: "ListKeys",
			Handler:    _KeyValueStore_ListKeys_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "github.com/rancher/opni/pkg/plugins/apis/system/system.proto",
}

KeyValueStore_ServiceDesc is the grpc.ServiceDesc for KeyValueStore 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 System_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "system.System",
	HandlerType: (*SystemServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "UseManagementAPI",
			Handler:    _System_UseManagementAPI_Handler,
		},
		{
			MethodName: "UseKeyValueStore",
			Handler:    _System_UseKeyValueStore_Handler,
		},
		{
			MethodName: "UseAPIExtensions",
			Handler:    _System_UseAPIExtensions_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "github.com/rancher/opni/pkg/plugins/apis/system/system.proto",
}

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

Functions

func NewPlugin

func NewPlugin(client SystemPluginClient) plugin.Plugin

func RegisterKeyValueStoreServer

func RegisterKeyValueStoreServer(s grpc.ServiceRegistrar, srv KeyValueStoreServer)

func RegisterSystemServer

func RegisterSystemServer(s grpc.ServiceRegistrar, srv SystemServer)

Types

type BrokerID

type BrokerID struct {
	Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*BrokerID) Descriptor deprecated

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

Deprecated: Use BrokerID.ProtoReflect.Descriptor instead.

func (*BrokerID) GetId

func (x *BrokerID) GetId() uint32

func (*BrokerID) ProtoMessage

func (*BrokerID) ProtoMessage()

func (*BrokerID) ProtoReflect

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

func (*BrokerID) Reset

func (x *BrokerID) Reset()

func (*BrokerID) String

func (x *BrokerID) String() string

type DialAddress added in v0.5.4

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

func (*DialAddress) Descriptor deprecated added in v0.5.4

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

Deprecated: Use DialAddress.ProtoReflect.Descriptor instead.

func (*DialAddress) GetValue added in v0.5.4

func (x *DialAddress) GetValue() string

func (*DialAddress) ProtoMessage added in v0.5.4

func (*DialAddress) ProtoMessage()

func (*DialAddress) ProtoReflect added in v0.5.4

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

func (*DialAddress) Reset added in v0.5.4

func (x *DialAddress) Reset()

func (*DialAddress) String added in v0.5.4

func (x *DialAddress) String() string

type ExtensionClientInterface added in v0.5.4

type ExtensionClientInterface interface {
	// Attempt to obtain a ClientConn such that the API extensions with the given
	// names will be available on that client. If the requested extension is not
	// available, it will retry until it becomes available, or until the context
	// is canceled.
	GetClientConn(ctx context.Context, serviceNames ...string) (grpc.ClientConnInterface, error)
}

ExtensionClientInterface allows plugins to obtain clients to API extensions implemented by other plugins.

type KVStoreClient

type KVStoreClient[T proto.Message] interface {
	Put(key string, value T) error
	Get(key string) (T, error)
	Delete(key string) error
	ListKeys(prefix string) ([]string, error)
}

T is a type such that *T is a proto.Message

func NewKVStoreClient added in v0.5.4

func NewKVStoreClient[T proto.Message](ctx context.Context, client KeyValueStoreClient) KVStoreClient[T]

type Key

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

func (*Key) Descriptor deprecated

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

Deprecated: Use Key.ProtoReflect.Descriptor instead.

func (*Key) GetKey

func (x *Key) GetKey() string

func (*Key) ProtoMessage

func (*Key) ProtoMessage()

func (*Key) ProtoReflect

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

func (*Key) Reset

func (x *Key) Reset()

func (*Key) String

func (x *Key) String() string

type KeyList

type KeyList struct {
	Items []string `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
	// contains filtered or unexported fields
}

func (*KeyList) Descriptor deprecated

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

Deprecated: Use KeyList.ProtoReflect.Descriptor instead.

func (*KeyList) GetItems

func (x *KeyList) GetItems() []string

func (*KeyList) ProtoMessage

func (*KeyList) ProtoMessage()

func (*KeyList) ProtoReflect

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

func (*KeyList) Reset

func (x *KeyList) Reset()

func (*KeyList) String

func (x *KeyList) String() string

type KeyValue

type KeyValue struct {
	Key   string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*KeyValue) Descriptor deprecated

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

Deprecated: Use KeyValue.ProtoReflect.Descriptor instead.

func (*KeyValue) GetKey

func (x *KeyValue) GetKey() string

func (*KeyValue) GetValue

func (x *KeyValue) GetValue() []byte

func (*KeyValue) ProtoMessage

func (*KeyValue) ProtoMessage()

func (*KeyValue) ProtoReflect

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

func (*KeyValue) Reset

func (x *KeyValue) Reset()

func (*KeyValue) String

func (x *KeyValue) String() string

type KeyValueStoreClient

type KeyValueStoreClient interface {
	Put(ctx context.Context, in *KeyValue, opts ...grpc.CallOption) (*emptypb.Empty, error)
	Get(ctx context.Context, in *Key, opts ...grpc.CallOption) (*Value, error)
	Delete(ctx context.Context, in *Key, opts ...grpc.CallOption) (*emptypb.Empty, error)
	ListKeys(ctx context.Context, in *Key, opts ...grpc.CallOption) (*KeyList, error)
}

KeyValueStoreClient is the client API for KeyValueStore 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.

type KeyValueStoreServer

type KeyValueStoreServer interface {
	Put(context.Context, *KeyValue) (*emptypb.Empty, error)
	Get(context.Context, *Key) (*Value, error)
	Delete(context.Context, *Key) (*emptypb.Empty, error)
	ListKeys(context.Context, *Key) (*KeyList, error)
	// contains filtered or unexported methods
}

KeyValueStoreServer is the server API for KeyValueStore service. All implementations must embed UnimplementedKeyValueStoreServer for forward compatibility

type SystemClient

type SystemClient interface {
	UseManagementAPI(ctx context.Context, in *BrokerID, opts ...grpc.CallOption) (*emptypb.Empty, error)
	UseKeyValueStore(ctx context.Context, in *BrokerID, opts ...grpc.CallOption) (*emptypb.Empty, error)
	UseAPIExtensions(ctx context.Context, in *DialAddress, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

SystemClient is the client API for System 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 NewSystemClient

func NewSystemClient(cc grpc.ClientConnInterface) SystemClient

type SystemPluginClient

type SystemPluginClient interface {
	UseManagementAPI(managementv1.ManagementClient)
	UseKeyValueStore(KeyValueStoreClient)
	UseAPIExtensions(ExtensionClientInterface)
	// contains filtered or unexported methods
}

type SystemPluginServer

type SystemPluginServer interface {
	ServeManagementAPI(managementv1.ManagementServer)
	ServeKeyValueStore(storage.KeyValueStore)
	ServeAPIExtensions(dialAddress string)
}

type SystemServer

type SystemServer interface {
	UseManagementAPI(context.Context, *BrokerID) (*emptypb.Empty, error)
	UseKeyValueStore(context.Context, *BrokerID) (*emptypb.Empty, error)
	UseAPIExtensions(context.Context, *DialAddress) (*emptypb.Empty, error)
	// contains filtered or unexported methods
}

SystemServer is the server API for System service. All implementations must embed UnimplementedSystemServer for forward compatibility

type UnimplementedKeyValueStoreServer

type UnimplementedKeyValueStoreServer struct {
}

UnimplementedKeyValueStoreServer must be embedded to have forward compatible implementations.

func (UnimplementedKeyValueStoreServer) Delete added in v0.5.4

func (UnimplementedKeyValueStoreServer) Get

func (UnimplementedKeyValueStoreServer) ListKeys

func (UnimplementedKeyValueStoreServer) Put

type UnimplementedSystemPluginClient added in v0.5.4

type UnimplementedSystemPluginClient struct{}

UnimplementedSystemPluginClient must be embedded to have forward compatible implementations.

func (UnimplementedSystemPluginClient) UseAPIExtensions added in v0.5.4

func (UnimplementedSystemPluginClient) UseKeyValueStore added in v0.5.4

func (UnimplementedSystemPluginClient) UseManagementAPI added in v0.5.4

type UnimplementedSystemServer

type UnimplementedSystemServer struct {
}

UnimplementedSystemServer must be embedded to have forward compatible implementations.

func (UnimplementedSystemServer) UseAPIExtensions added in v0.5.4

func (UnimplementedSystemServer) UseKeyValueStore

func (UnimplementedSystemServer) UseManagementAPI

type UnsafeKeyValueStoreServer

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

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

type UnsafeSystemServer

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

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

type Value

type Value struct {
	Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*Value) Descriptor deprecated

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

Deprecated: Use Value.ProtoReflect.Descriptor instead.

func (*Value) GetValue

func (x *Value) GetValue() []byte

func (*Value) ProtoMessage

func (*Value) ProtoMessage()

func (*Value) ProtoReflect

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

func (*Value) Reset

func (x *Value) Reset()

func (*Value) String

func (x *Value) String() string

Jump to

Keyboard shortcuts

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