Documentation ¶
Index ¶
- Constants
- Variables
- func DRPCRegisterAccessRpcService(mux drpc.Mux, impl DRPCAccessRpcServiceServer) error
- func NewSRPCAccessRpcServiceHandler(impl SRPCAccessRpcServiceServer, serviceID string) srpc.Handler
- func SRPCRegisterAccessRpcService(mux srpc.Mux, impl SRPCAccessRpcServiceServer) error
- type AccessClientFunc
- type AccessRpcServiceServer
- type ClientController
- func (c *ClientController) AccessClient(ctx context.Context, ...) error
- func (c *ClientController) Close() error
- func (c *ClientController) Execute(ctx context.Context) error
- func (c *ClientController) GetControllerInfo() *controller.Info
- func (c *ClientController) HandleDirective(ctx context.Context, di directive.Instance) ([]directive.Resolver, error)
- type DRPCAccessRpcServiceClient
- type DRPCAccessRpcServiceDescription
- type DRPCAccessRpcServiceServer
- type DRPCAccessRpcServiceUnimplementedServer
- type DRPCAccessRpcService_CallRpcServiceClient
- type DRPCAccessRpcService_CallRpcServiceStream
- type DRPCAccessRpcService_LookupRpcServiceClient
- type DRPCAccessRpcService_LookupRpcServiceStream
- type LookupRpcServiceRequest
- func (m *LookupRpcServiceRequest) CloneGenericVT() proto.Message
- func (m *LookupRpcServiceRequest) CloneVT() *LookupRpcServiceRequest
- func (*LookupRpcServiceRequest) Descriptor() ([]byte, []int)deprecated
- func (this *LookupRpcServiceRequest) EqualVT(that *LookupRpcServiceRequest) bool
- func (x *LookupRpcServiceRequest) GetServerId() string
- func (x *LookupRpcServiceRequest) GetServiceId() string
- func (r *LookupRpcServiceRequest) MarshalComponentID() (string, error)
- func (m *LookupRpcServiceRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *LookupRpcServiceRequest) MarshalToVT(dAtA []byte) (int, error)
- func (m *LookupRpcServiceRequest) MarshalVT() (dAtA []byte, err error)
- func (*LookupRpcServiceRequest) ProtoMessage()
- func (x *LookupRpcServiceRequest) ProtoReflect() protoreflect.Message
- func (x *LookupRpcServiceRequest) Reset()
- func (m *LookupRpcServiceRequest) SizeVT() (n int)
- func (x *LookupRpcServiceRequest) String() string
- func (r *LookupRpcServiceRequest) ToDirective() bifrost_rpc.LookupRpcService
- func (r *LookupRpcServiceRequest) UnmarshalComponentID(componentID string) error
- func (m *LookupRpcServiceRequest) UnmarshalVT(dAtA []byte) error
- func (r *LookupRpcServiceRequest) Validate() error
- type LookupRpcServiceResolver
- type LookupRpcServiceResponse
- func (m *LookupRpcServiceResponse) CloneGenericVT() proto.Message
- func (m *LookupRpcServiceResponse) CloneVT() *LookupRpcServiceResponse
- func (*LookupRpcServiceResponse) Descriptor() ([]byte, []int)deprecated
- func (this *LookupRpcServiceResponse) EqualVT(that *LookupRpcServiceResponse) bool
- func (x *LookupRpcServiceResponse) GetExists() bool
- func (x *LookupRpcServiceResponse) GetIdle() bool
- func (x *LookupRpcServiceResponse) GetRemoved() bool
- func (m *LookupRpcServiceResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *LookupRpcServiceResponse) MarshalToVT(dAtA []byte) (int, error)
- func (m *LookupRpcServiceResponse) MarshalVT() (dAtA []byte, err error)
- func (*LookupRpcServiceResponse) ProtoMessage()
- func (x *LookupRpcServiceResponse) ProtoReflect() protoreflect.Message
- func (x *LookupRpcServiceResponse) Reset()
- func (m *LookupRpcServiceResponse) SizeVT() (n int)
- func (x *LookupRpcServiceResponse) String() string
- func (m *LookupRpcServiceResponse) UnmarshalVT(dAtA []byte) error
- type ProxyInvoker
- type SRPCAccessRpcServiceClient
- type SRPCAccessRpcServiceHandler
- func (SRPCAccessRpcServiceHandler) GetMethodIDs() []string
- func (d *SRPCAccessRpcServiceHandler) GetServiceID() string
- func (d *SRPCAccessRpcServiceHandler) InvokeMethod(serviceID, methodID string, strm srpc.Stream) (bool, error)
- func (SRPCAccessRpcServiceHandler) InvokeMethod_CallRpcService(impl SRPCAccessRpcServiceServer, strm srpc.Stream) error
- func (SRPCAccessRpcServiceHandler) InvokeMethod_LookupRpcService(impl SRPCAccessRpcServiceServer, strm srpc.Stream) error
- type SRPCAccessRpcServiceServer
- type SRPCAccessRpcServiceUnimplementedServer
- type SRPCAccessRpcService_CallRpcServiceClient
- type SRPCAccessRpcService_CallRpcServiceStream
- type SRPCAccessRpcService_LookupRpcServiceClient
- type SRPCAccessRpcService_LookupRpcServiceStream
Constants ¶
const SRPCAccessRpcServiceServiceID = "bifrost.rpc.access.AccessRpcService"
Variables ¶
var ( ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflow = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") )
var File_github_com_aperturerobotics_bifrost_rpc_access_access_proto protoreflect.FileDescriptor
Functions ¶
func DRPCRegisterAccessRpcService ¶
func DRPCRegisterAccessRpcService(mux drpc.Mux, impl DRPCAccessRpcServiceServer) error
func NewSRPCAccessRpcServiceHandler ¶
func NewSRPCAccessRpcServiceHandler(impl SRPCAccessRpcServiceServer, serviceID string) srpc.Handler
NewSRPCAccessRpcServiceHandler constructs a new RPC handler. serviceID: if empty, uses default: bifrost.rpc.access.AccessRpcService
func SRPCRegisterAccessRpcService ¶
func SRPCRegisterAccessRpcService(mux srpc.Mux, impl SRPCAccessRpcServiceServer) error
SRPCRegisterAccessRpcService registers the implementation with the mux. Uses the default serviceID: bifrost.rpc.access.AccessRpcService
Types ¶
type AccessClientFunc ¶ added in v0.9.4
type AccessClientFunc func( ctx context.Context, cb func(ctx context.Context, client SRPCAccessRpcServiceClient) error, ) error
AccessClientFunc is a function to access the AccessRpcServiceClient. The client should be released after the function returns. If the client is no longer valid, cancel the context.
func NewAccessClientFunc ¶ added in v0.9.4
func NewAccessClientFunc(svc SRPCAccessRpcServiceClient) AccessClientFunc
NewAccessClientFunc constructs a AccessClientFunc with a static client.
type AccessRpcServiceServer ¶
type AccessRpcServiceServer struct {
// contains filtered or unexported fields
}
AccessRpcServiceServer is the server for AccessRpcService.
func NewAccessRpcServiceServer ¶
func NewAccessRpcServiceServer(b bus.Bus) *AccessRpcServiceServer
NewAccessRpcServiceServer builds a AccessRpcService server with a bus.
func (*AccessRpcServiceServer) CallRpcService ¶
func (s *AccessRpcServiceServer) CallRpcService(strm SRPCAccessRpcService_CallRpcServiceStream) error
CallRpcService looks up the rpc service with the request & invokes the RPC.
func (*AccessRpcServiceServer) LookupRpcService ¶
func (s *AccessRpcServiceServer) LookupRpcService( req *LookupRpcServiceRequest, strm SRPCAccessRpcService_LookupRpcServiceStream, ) error
LookupRpcService looks up the rpc service via the bus.
type ClientController ¶
type ClientController struct {
// contains filtered or unexported fields
}
ClientController resolves LookupRpcService with an AccessRpcService client.
func NewClientController ¶
func NewClientController( info *controller.Info, svc AccessClientFunc, serviceIDRe *regexp.Regexp, serverIDRe *regexp.Regexp, ) *ClientController
NewClientController constructs the controller. The regex fields can both be nil to accept any.
func (*ClientController) AccessClient ¶ added in v0.9.4
func (c *ClientController) AccessClient( ctx context.Context, cb func(ctx context.Context, client SRPCAccessRpcServiceClient) error, ) error
AccessClient adds a reference to the client and waits for it to be built. Releases the client when the function returns.
func (*ClientController) Close ¶
func (c *ClientController) Close() error
Close releases any resources used by the controller.
func (*ClientController) Execute ¶
func (c *ClientController) Execute(ctx context.Context) error
Execute executes the given controller.
func (*ClientController) GetControllerInfo ¶
func (c *ClientController) GetControllerInfo() *controller.Info
GetControllerInfo returns the controller info.
func (*ClientController) HandleDirective ¶
func (c *ClientController) HandleDirective(ctx context.Context, di directive.Instance) ([]directive.Resolver, error)
HandleDirective asks if the handler can resolve the directive.
type DRPCAccessRpcServiceClient ¶
type DRPCAccessRpcServiceClient interface { DRPCConn() drpc.Conn LookupRpcService(ctx context.Context, in *LookupRpcServiceRequest) (DRPCAccessRpcService_LookupRpcServiceClient, error) CallRpcService(ctx context.Context) (DRPCAccessRpcService_CallRpcServiceClient, error) }
func NewDRPCAccessRpcServiceClient ¶
func NewDRPCAccessRpcServiceClient(cc drpc.Conn) DRPCAccessRpcServiceClient
type DRPCAccessRpcServiceDescription ¶
type DRPCAccessRpcServiceDescription struct{}
func (DRPCAccessRpcServiceDescription) NumMethods ¶
func (DRPCAccessRpcServiceDescription) NumMethods() int
type DRPCAccessRpcServiceServer ¶
type DRPCAccessRpcServiceServer interface { LookupRpcService(*LookupRpcServiceRequest, DRPCAccessRpcService_LookupRpcServiceStream) error CallRpcService(DRPCAccessRpcService_CallRpcServiceStream) error }
type DRPCAccessRpcServiceUnimplementedServer ¶
type DRPCAccessRpcServiceUnimplementedServer struct{}
func (*DRPCAccessRpcServiceUnimplementedServer) CallRpcService ¶
func (s *DRPCAccessRpcServiceUnimplementedServer) CallRpcService(DRPCAccessRpcService_CallRpcServiceStream) error
func (*DRPCAccessRpcServiceUnimplementedServer) LookupRpcService ¶
func (s *DRPCAccessRpcServiceUnimplementedServer) LookupRpcService(*LookupRpcServiceRequest, DRPCAccessRpcService_LookupRpcServiceStream) error
type DRPCAccessRpcService_CallRpcServiceClient ¶
type DRPCAccessRpcService_CallRpcServiceClient interface { drpc.Stream Send(*rpcstream.RpcStreamPacket) error Recv() (*rpcstream.RpcStreamPacket, error) }
type DRPCAccessRpcService_CallRpcServiceStream ¶
type DRPCAccessRpcService_CallRpcServiceStream interface { drpc.Stream Send(*rpcstream.RpcStreamPacket) error Recv() (*rpcstream.RpcStreamPacket, error) }
type DRPCAccessRpcService_LookupRpcServiceClient ¶
type DRPCAccessRpcService_LookupRpcServiceClient interface { drpc.Stream Recv() (*LookupRpcServiceResponse, error) }
type DRPCAccessRpcService_LookupRpcServiceStream ¶
type DRPCAccessRpcService_LookupRpcServiceStream interface { drpc.Stream Send(*LookupRpcServiceResponse) error }
type LookupRpcServiceRequest ¶
type LookupRpcServiceRequest struct { // ServiceId is the service identifier. ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` // ServerId is the identifier of the server requesting the service. // Can be empty. ServerId string `protobuf:"bytes,2,opt,name=server_id,json=serverId,proto3" json:"server_id,omitempty"` // contains filtered or unexported fields }
LookupRpcServiceRequest is a request to lookup an rpc service.
func NewLookupRpcServiceRequest ¶
func NewLookupRpcServiceRequest(serviceID, serverID string) *LookupRpcServiceRequest
NewLookupRpcServiceRequest constructs a new LookupRpcServiceRequest.
func RequestFromDirective ¶
func RequestFromDirective(dir bifrost_rpc.LookupRpcService) *LookupRpcServiceRequest
RequestFromDirective converts a LookupRpcService directive to a request.
func (*LookupRpcServiceRequest) CloneGenericVT ¶
func (m *LookupRpcServiceRequest) CloneGenericVT() proto.Message
func (*LookupRpcServiceRequest) CloneVT ¶
func (m *LookupRpcServiceRequest) CloneVT() *LookupRpcServiceRequest
func (*LookupRpcServiceRequest) Descriptor
deprecated
func (*LookupRpcServiceRequest) Descriptor() ([]byte, []int)
Deprecated: Use LookupRpcServiceRequest.ProtoReflect.Descriptor instead.
func (*LookupRpcServiceRequest) EqualVT ¶
func (this *LookupRpcServiceRequest) EqualVT(that *LookupRpcServiceRequest) bool
func (*LookupRpcServiceRequest) GetServerId ¶
func (x *LookupRpcServiceRequest) GetServerId() string
func (*LookupRpcServiceRequest) GetServiceId ¶
func (x *LookupRpcServiceRequest) GetServiceId() string
func (*LookupRpcServiceRequest) MarshalComponentID ¶
func (r *LookupRpcServiceRequest) MarshalComponentID() (string, error)
MarshalComponentID marshals the b58 component ID.
func (*LookupRpcServiceRequest) MarshalToSizedBufferVT ¶
func (m *LookupRpcServiceRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*LookupRpcServiceRequest) MarshalToVT ¶
func (m *LookupRpcServiceRequest) MarshalToVT(dAtA []byte) (int, error)
func (*LookupRpcServiceRequest) MarshalVT ¶
func (m *LookupRpcServiceRequest) MarshalVT() (dAtA []byte, err error)
func (*LookupRpcServiceRequest) ProtoMessage ¶
func (*LookupRpcServiceRequest) ProtoMessage()
func (*LookupRpcServiceRequest) ProtoReflect ¶
func (x *LookupRpcServiceRequest) ProtoReflect() protoreflect.Message
func (*LookupRpcServiceRequest) Reset ¶
func (x *LookupRpcServiceRequest) Reset()
func (*LookupRpcServiceRequest) SizeVT ¶
func (m *LookupRpcServiceRequest) SizeVT() (n int)
func (*LookupRpcServiceRequest) String ¶
func (x *LookupRpcServiceRequest) String() string
func (*LookupRpcServiceRequest) ToDirective ¶
func (r *LookupRpcServiceRequest) ToDirective() bifrost_rpc.LookupRpcService
ToDirective converts the request to a directive.
func (*LookupRpcServiceRequest) UnmarshalComponentID ¶
func (r *LookupRpcServiceRequest) UnmarshalComponentID(componentID string) error
UnmarshalComponentID unmarshals the component ID.
func (*LookupRpcServiceRequest) UnmarshalVT ¶
func (m *LookupRpcServiceRequest) UnmarshalVT(dAtA []byte) error
func (*LookupRpcServiceRequest) Validate ¶
func (r *LookupRpcServiceRequest) Validate() error
Validate validates the LookupRpcServiceRequest.
type LookupRpcServiceResolver ¶
type LookupRpcServiceResolver struct {
// contains filtered or unexported fields
}
LookupRpcServiceResolver resolves a LookupRpcService directive with a RPC service.
func NewLookupRpcServiceResolver ¶
func NewLookupRpcServiceResolver( dir bifrost_rpc.LookupRpcService, svc AccessClientFunc, ) *LookupRpcServiceResolver
NewLookupRpcServiceResolver constructs the directive resolver.
func (*LookupRpcServiceResolver) Resolve ¶
func (r *LookupRpcServiceResolver) Resolve(ctx context.Context, handler directive.ResolverHandler) error
Resolve resolves the values, emitting them to the handler.
type LookupRpcServiceResponse ¶
type LookupRpcServiceResponse struct { // Idle indicates the directive is now idle. Idle bool `protobuf:"varint,1,opt,name=idle,proto3" json:"idle,omitempty"` // Exists indicates we found the service on the remote. Exists bool `protobuf:"varint,2,opt,name=exists,proto3" json:"exists,omitempty"` // Removed indicates the value no longer exists. Removed bool `protobuf:"varint,3,opt,name=removed,proto3" json:"removed,omitempty"` // contains filtered or unexported fields }
LookupRpcServiceResponse is a response to LookupRpcService
func (*LookupRpcServiceResponse) CloneGenericVT ¶
func (m *LookupRpcServiceResponse) CloneGenericVT() proto.Message
func (*LookupRpcServiceResponse) CloneVT ¶
func (m *LookupRpcServiceResponse) CloneVT() *LookupRpcServiceResponse
func (*LookupRpcServiceResponse) Descriptor
deprecated
func (*LookupRpcServiceResponse) Descriptor() ([]byte, []int)
Deprecated: Use LookupRpcServiceResponse.ProtoReflect.Descriptor instead.
func (*LookupRpcServiceResponse) EqualVT ¶
func (this *LookupRpcServiceResponse) EqualVT(that *LookupRpcServiceResponse) bool
func (*LookupRpcServiceResponse) GetExists ¶
func (x *LookupRpcServiceResponse) GetExists() bool
func (*LookupRpcServiceResponse) GetIdle ¶
func (x *LookupRpcServiceResponse) GetIdle() bool
func (*LookupRpcServiceResponse) GetRemoved ¶
func (x *LookupRpcServiceResponse) GetRemoved() bool
func (*LookupRpcServiceResponse) MarshalToSizedBufferVT ¶
func (m *LookupRpcServiceResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*LookupRpcServiceResponse) MarshalToVT ¶
func (m *LookupRpcServiceResponse) MarshalToVT(dAtA []byte) (int, error)
func (*LookupRpcServiceResponse) MarshalVT ¶
func (m *LookupRpcServiceResponse) MarshalVT() (dAtA []byte, err error)
func (*LookupRpcServiceResponse) ProtoMessage ¶
func (*LookupRpcServiceResponse) ProtoMessage()
func (*LookupRpcServiceResponse) ProtoReflect ¶
func (x *LookupRpcServiceResponse) ProtoReflect() protoreflect.Message
func (*LookupRpcServiceResponse) Reset ¶
func (x *LookupRpcServiceResponse) Reset()
func (*LookupRpcServiceResponse) SizeVT ¶
func (m *LookupRpcServiceResponse) SizeVT() (n int)
func (*LookupRpcServiceResponse) String ¶
func (x *LookupRpcServiceResponse) String() string
func (*LookupRpcServiceResponse) UnmarshalVT ¶
func (m *LookupRpcServiceResponse) UnmarshalVT(dAtA []byte) error
type ProxyInvoker ¶
type ProxyInvoker struct {
// contains filtered or unexported fields
}
ProxyInvoker is an srpc.Invoker that invokes via the proxy client.
func NewProxyInvoker ¶
func NewProxyInvoker(client SRPCAccessRpcServiceClient, req *LookupRpcServiceRequest) *ProxyInvoker
NewProxyInvoker constructs a new srpc.Invoker with a client and request.
func (*ProxyInvoker) InvokeMethod ¶
InvokeMethod invokes the method matching the service & method ID. Returns false, nil if not found. If service string is empty, ignore it.
type SRPCAccessRpcServiceClient ¶
type SRPCAccessRpcServiceClient interface { SRPCClient() srpc.Client LookupRpcService(ctx context.Context, in *LookupRpcServiceRequest) (SRPCAccessRpcService_LookupRpcServiceClient, error) CallRpcService(ctx context.Context) (SRPCAccessRpcService_CallRpcServiceClient, error) }
func NewSRPCAccessRpcServiceClient ¶
func NewSRPCAccessRpcServiceClient(cc srpc.Client) SRPCAccessRpcServiceClient
func NewSRPCAccessRpcServiceClientWithServiceID ¶
func NewSRPCAccessRpcServiceClientWithServiceID(cc srpc.Client, serviceID string) SRPCAccessRpcServiceClient
type SRPCAccessRpcServiceHandler ¶
type SRPCAccessRpcServiceHandler struct {
// contains filtered or unexported fields
}
func (SRPCAccessRpcServiceHandler) GetMethodIDs ¶
func (SRPCAccessRpcServiceHandler) GetMethodIDs() []string
func (*SRPCAccessRpcServiceHandler) GetServiceID ¶
func (d *SRPCAccessRpcServiceHandler) GetServiceID() string
func (*SRPCAccessRpcServiceHandler) InvokeMethod ¶
func (SRPCAccessRpcServiceHandler) InvokeMethod_CallRpcService ¶
func (SRPCAccessRpcServiceHandler) InvokeMethod_CallRpcService(impl SRPCAccessRpcServiceServer, strm srpc.Stream) error
func (SRPCAccessRpcServiceHandler) InvokeMethod_LookupRpcService ¶
func (SRPCAccessRpcServiceHandler) InvokeMethod_LookupRpcService(impl SRPCAccessRpcServiceServer, strm srpc.Stream) error
type SRPCAccessRpcServiceServer ¶
type SRPCAccessRpcServiceServer interface { LookupRpcService(*LookupRpcServiceRequest, SRPCAccessRpcService_LookupRpcServiceStream) error CallRpcService(SRPCAccessRpcService_CallRpcServiceStream) error }
type SRPCAccessRpcServiceUnimplementedServer ¶
type SRPCAccessRpcServiceUnimplementedServer struct{}
func (*SRPCAccessRpcServiceUnimplementedServer) CallRpcService ¶
func (s *SRPCAccessRpcServiceUnimplementedServer) CallRpcService(SRPCAccessRpcService_CallRpcServiceStream) error
func (*SRPCAccessRpcServiceUnimplementedServer) LookupRpcService ¶
func (s *SRPCAccessRpcServiceUnimplementedServer) LookupRpcService(*LookupRpcServiceRequest, SRPCAccessRpcService_LookupRpcServiceStream) error
type SRPCAccessRpcService_CallRpcServiceClient ¶
type SRPCAccessRpcService_CallRpcServiceClient interface { srpc.Stream Send(*rpcstream.RpcStreamPacket) error Recv() (*rpcstream.RpcStreamPacket, error) RecvTo(*rpcstream.RpcStreamPacket) error }
type SRPCAccessRpcService_CallRpcServiceStream ¶
type SRPCAccessRpcService_CallRpcServiceStream interface { srpc.Stream Send(*rpcstream.RpcStreamPacket) error SendAndClose(*rpcstream.RpcStreamPacket) error Recv() (*rpcstream.RpcStreamPacket, error) }
type SRPCAccessRpcService_LookupRpcServiceClient ¶
type SRPCAccessRpcService_LookupRpcServiceClient interface { srpc.Stream Recv() (*LookupRpcServiceResponse, error) RecvTo(*LookupRpcServiceResponse) error }
type SRPCAccessRpcService_LookupRpcServiceStream ¶
type SRPCAccessRpcService_LookupRpcServiceStream interface { srpc.Stream Send(*LookupRpcServiceResponse) error SendAndClose(*LookupRpcServiceResponse) error }