apiserver

package
v0.24.1-patch1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_api_server_proto protoreflect.FileDescriptor

Functions

func RegisterApiServerServer

func RegisterApiServerServer(s *grpc.Server, srv ApiServerServer)

func TypeUrl

func TypeUrl(m resources.ProtoResource) string

Types

type ApiServer

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

func (*ApiServer) Delete

func (s *ApiServer) Delete(ctx context.Context, req *DeleteRequest) (*DeleteResponse, error)

func (*ApiServer) List

func (s *ApiServer) List(ctx context.Context, req *ListRequest) (*ListResponse, error)

func (*ApiServer) Read

func (s *ApiServer) Read(ctx context.Context, req *ReadRequest) (*ReadResponse, error)

func (*ApiServer) Register

func (s *ApiServer) Register(ctx context.Context, req *RegisterRequest) (*RegisterResponse, error)

func (*ApiServer) Watch

func (s *ApiServer) Watch(req *WatchRequest, watch ApiServer_WatchServer) error

func (*ApiServer) Write

func (s *ApiServer) Write(ctx context.Context, req *WriteRequest) (*WriteResponse, error)

type ApiServerClient

type ApiServerClient interface {
	Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error)
	Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (*ReadResponse, error)
	Write(ctx context.Context, in *WriteRequest, opts ...grpc.CallOption) (*WriteResponse, error)
	Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error)
	List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error)
	Watch(ctx context.Context, in *WatchRequest, opts ...grpc.CallOption) (ApiServer_WatchClient, error)
}

ApiServerClient is the client API for ApiServer service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewApiServerClient

func NewApiServerClient(cc grpc.ClientConnInterface) ApiServerClient

type ApiServerServer

ApiServerServer is the server API for ApiServer service.

func NewApiServer

func NewApiServer(s *grpc.Server, callbacks Callbacks, factory factory.ResourceClientFactory, watchRefreshDuration time.Duration, resourceTypes ...resources.ProtoResource) ApiServerServer

TODO(yuval-k): can we get rid of watchRefreshDuration ? sounds like this should be the ResourceClientFactory responsibility

type ApiServer_WatchClient

type ApiServer_WatchClient interface {
	Recv() (*ListResponse, error)
	grpc.ClientStream
}

type ApiServer_WatchServer

type ApiServer_WatchServer interface {
	Send(*ListResponse) error
	grpc.ServerStream
}

type Callbacks

type Callbacks interface {
	OnRegister(ctx context.Context, req *RegisterRequest) (*RegisterResponse, error)
	OnRead(ctx context.Context, req *ReadRequest) (*ReadResponse, error)
	OnWrite(ctx context.Context, req *WriteRequest) (*WriteResponse, error)
	OnDelete(ctx context.Context, req *DeleteRequest) (*DeleteResponse, error)
	OnList(ctx context.Context, req *ListRequest) (*ListResponse, error)
	OnWatch(req *WatchRequest, watch ApiServer_WatchServer) error
}

type DeleteRequest

type DeleteRequest struct {
	Name           string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Namespace      string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"`
	TypeUrl        string `protobuf:"bytes,3,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"`
	IgnoreNotExist bool   `protobuf:"varint,4,opt,name=ignore_not_exist,json=ignoreNotExist,proto3" json:"ignore_not_exist,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteRequest) Descriptor deprecated

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

Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.

func (*DeleteRequest) GetIgnoreNotExist

func (x *DeleteRequest) GetIgnoreNotExist() bool

func (*DeleteRequest) GetName

func (x *DeleteRequest) GetName() string

func (*DeleteRequest) GetNamespace

func (x *DeleteRequest) GetNamespace() string

func (*DeleteRequest) GetTypeUrl

func (x *DeleteRequest) GetTypeUrl() string

func (*DeleteRequest) ProtoMessage

func (*DeleteRequest) ProtoMessage()

func (*DeleteRequest) ProtoReflect added in v0.16.0

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

func (*DeleteRequest) Reset

func (x *DeleteRequest) Reset()

func (*DeleteRequest) String

func (x *DeleteRequest) String() string

type DeleteResponse

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

func (*DeleteResponse) Descriptor deprecated

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

Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead.

func (*DeleteResponse) ProtoMessage

func (*DeleteResponse) ProtoMessage()

func (*DeleteResponse) ProtoReflect added in v0.16.0

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

func (*DeleteResponse) Reset

func (x *DeleteResponse) Reset()

func (*DeleteResponse) String

func (x *DeleteResponse) String() string

type ListRequest

type ListRequest struct {
	Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
	TypeUrl   string `protobuf:"bytes,2,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"`
	// contains filtered or unexported fields
}

func (*ListRequest) Descriptor deprecated

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

Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.

func (*ListRequest) GetNamespace

func (x *ListRequest) GetNamespace() string

func (*ListRequest) GetTypeUrl

func (x *ListRequest) GetTypeUrl() string

func (*ListRequest) ProtoMessage

func (*ListRequest) ProtoMessage()

func (*ListRequest) ProtoReflect added in v0.16.0

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

func (*ListRequest) Reset

func (x *ListRequest) Reset()

func (*ListRequest) String

func (x *ListRequest) String() string

type ListResponse

type ListResponse struct {
	ResourceList []*any.Any `protobuf:"bytes,1,rep,name=resource_list,json=resourceList,proto3" json:"resource_list,omitempty"`
	// contains filtered or unexported fields
}

func (*ListResponse) Descriptor deprecated

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

Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.

func (*ListResponse) GetResourceList

func (x *ListResponse) GetResourceList() []*any.Any

func (*ListResponse) ProtoMessage

func (*ListResponse) ProtoMessage()

func (*ListResponse) ProtoReflect added in v0.16.0

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

func (*ListResponse) Reset

func (x *ListResponse) Reset()

func (*ListResponse) String

func (x *ListResponse) String() string

type ReadRequest

type ReadRequest struct {
	Name      string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"`
	TypeUrl   string `protobuf:"bytes,3,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"`
	// contains filtered or unexported fields
}

GRPC stuff

func (*ReadRequest) Descriptor deprecated

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

Deprecated: Use ReadRequest.ProtoReflect.Descriptor instead.

func (*ReadRequest) GetName

func (x *ReadRequest) GetName() string

func (*ReadRequest) GetNamespace

func (x *ReadRequest) GetNamespace() string

func (*ReadRequest) GetTypeUrl

func (x *ReadRequest) GetTypeUrl() string

func (*ReadRequest) ProtoMessage

func (*ReadRequest) ProtoMessage()

func (*ReadRequest) ProtoReflect added in v0.16.0

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

func (*ReadRequest) Reset

func (x *ReadRequest) Reset()

func (*ReadRequest) String

func (x *ReadRequest) String() string

type ReadResponse

type ReadResponse struct {
	Resource *any.Any `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"`
	// contains filtered or unexported fields
}

func (*ReadResponse) Descriptor deprecated

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

Deprecated: Use ReadResponse.ProtoReflect.Descriptor instead.

func (*ReadResponse) GetResource

func (x *ReadResponse) GetResource() *any.Any

func (*ReadResponse) ProtoMessage

func (*ReadResponse) ProtoMessage()

func (*ReadResponse) ProtoReflect added in v0.16.0

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

func (*ReadResponse) Reset

func (x *ReadResponse) Reset()

func (*ReadResponse) String

func (x *ReadResponse) String() string

type RegisterRequest

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

func (*RegisterRequest) Descriptor deprecated

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

Deprecated: Use RegisterRequest.ProtoReflect.Descriptor instead.

func (*RegisterRequest) ProtoMessage

func (*RegisterRequest) ProtoMessage()

func (*RegisterRequest) ProtoReflect added in v0.16.0

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

func (*RegisterRequest) Reset

func (x *RegisterRequest) Reset()

func (*RegisterRequest) String

func (x *RegisterRequest) String() string

type RegisterResponse

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

func (*RegisterResponse) Descriptor deprecated

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

Deprecated: Use RegisterResponse.ProtoReflect.Descriptor instead.

func (*RegisterResponse) ProtoMessage

func (*RegisterResponse) ProtoMessage()

func (*RegisterResponse) ProtoReflect added in v0.16.0

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

func (*RegisterResponse) Reset

func (x *RegisterResponse) Reset()

func (*RegisterResponse) String

func (x *RegisterResponse) String() string

type UnimplementedApiServerServer

type UnimplementedApiServerServer struct {
}

UnimplementedApiServerServer can be embedded to have forward compatible implementations.

func (*UnimplementedApiServerServer) Delete

func (*UnimplementedApiServerServer) List

func (*UnimplementedApiServerServer) Read

func (*UnimplementedApiServerServer) Register

func (*UnimplementedApiServerServer) Watch

func (*UnimplementedApiServerServer) Write

type WatchRequest

type WatchRequest struct {
	Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
	TypeUrl   string `protobuf:"bytes,2,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"`
	// contains filtered or unexported fields
}

func (*WatchRequest) Descriptor deprecated

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

Deprecated: Use WatchRequest.ProtoReflect.Descriptor instead.

func (*WatchRequest) GetNamespace

func (x *WatchRequest) GetNamespace() string

func (*WatchRequest) GetTypeUrl

func (x *WatchRequest) GetTypeUrl() string

func (*WatchRequest) ProtoMessage

func (*WatchRequest) ProtoMessage()

func (*WatchRequest) ProtoReflect added in v0.16.0

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

func (*WatchRequest) Reset

func (x *WatchRequest) Reset()

func (*WatchRequest) String

func (x *WatchRequest) String() string

type WatchResponse

type WatchResponse struct {
	ResourceList []*any.Any `protobuf:"bytes,1,rep,name=resource_list,json=resourceList,proto3" json:"resource_list,omitempty"`
	// contains filtered or unexported fields
}

func (*WatchResponse) Descriptor deprecated

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

Deprecated: Use WatchResponse.ProtoReflect.Descriptor instead.

func (*WatchResponse) GetResourceList

func (x *WatchResponse) GetResourceList() []*any.Any

func (*WatchResponse) ProtoMessage

func (*WatchResponse) ProtoMessage()

func (*WatchResponse) ProtoReflect added in v0.16.0

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

func (*WatchResponse) Reset

func (x *WatchResponse) Reset()

func (*WatchResponse) String

func (x *WatchResponse) String() string

type WriteRequest

type WriteRequest struct {
	Resource          *any.Any `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"`
	OverwriteExisting bool     `protobuf:"varint,2,opt,name=overwrite_existing,json=overwriteExisting,proto3" json:"overwrite_existing,omitempty"`
	// contains filtered or unexported fields
}

func (*WriteRequest) Descriptor deprecated

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

Deprecated: Use WriteRequest.ProtoReflect.Descriptor instead.

func (*WriteRequest) GetOverwriteExisting

func (x *WriteRequest) GetOverwriteExisting() bool

func (*WriteRequest) GetResource

func (x *WriteRequest) GetResource() *any.Any

func (*WriteRequest) ProtoMessage

func (*WriteRequest) ProtoMessage()

func (*WriteRequest) ProtoReflect added in v0.16.0

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

func (*WriteRequest) Reset

func (x *WriteRequest) Reset()

func (*WriteRequest) String

func (x *WriteRequest) String() string

type WriteResponse

type WriteResponse struct {
	Resource *any.Any `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"`
	// contains filtered or unexported fields
}

func (*WriteResponse) Descriptor deprecated

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

Deprecated: Use WriteResponse.ProtoReflect.Descriptor instead.

func (*WriteResponse) GetResource

func (x *WriteResponse) GetResource() *any.Any

func (*WriteResponse) ProtoMessage

func (*WriteResponse) ProtoMessage()

func (*WriteResponse) ProtoReflect added in v0.16.0

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

func (*WriteResponse) Reset

func (x *WriteResponse) Reset()

func (*WriteResponse) String

func (x *WriteResponse) String() string

Jump to

Keyboard shortcuts

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