Documentation ¶
Overview ¶
Package admin is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterAdminHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterAdminHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AdminClient) error
- func RegisterAdminHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterAdminHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AdminServer) error
- func RegisterAdminServer(s grpc.ServiceRegistrar, srv AdminServer)
- type AdminClient
- type AdminServer
- type RunCommandRequest
- func (*RunCommandRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RunCommandRequest) GetCommandName() string
- func (x *RunCommandRequest) GetData() *structpb.Struct
- func (*RunCommandRequest) ProtoMessage()
- func (x *RunCommandRequest) ProtoReflect() protoreflect.Message
- func (x *RunCommandRequest) Reset()
- func (x *RunCommandRequest) String() string
- type RunCommandResponse
- type UnimplementedAdminServer
- type UnsafeAdminServer
Constants ¶
This section is empty.
Variables ¶
var Admin_ServiceDesc = grpc.ServiceDesc{ ServiceName: "admin.Admin", HandlerType: (*AdminServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "RunCommand", Handler: _Admin_RunCommand_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "admin/admin.proto", }
Admin_ServiceDesc is the grpc.ServiceDesc for Admin service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_admin_admin_proto protoreflect.FileDescriptor
Functions ¶
func RegisterAdminHandler ¶
RegisterAdminHandler registers the http handlers for service Admin to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterAdminHandlerClient ¶
func RegisterAdminHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AdminClient) error
RegisterAdminHandlerClient registers the http handlers for service Admin to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AdminClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AdminClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "AdminClient" to call the correct interceptors.
func RegisterAdminHandlerFromEndpoint ¶
func RegisterAdminHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterAdminHandlerFromEndpoint is same as RegisterAdminHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterAdminHandlerServer ¶
func RegisterAdminHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AdminServer) error
RegisterAdminHandlerServer registers the http handlers for service Admin to "mux". UnaryRPC :call AdminServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAdminHandlerFromEndpoint instead.
func RegisterAdminServer ¶
func RegisterAdminServer(s grpc.ServiceRegistrar, srv AdminServer)
Types ¶
type AdminClient ¶
type AdminClient interface { // RunCommand sends a command to the admin server. RunCommand(ctx context.Context, in *RunCommandRequest, opts ...grpc.CallOption) (*RunCommandResponse, error) }
AdminClient is the client API for Admin 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 NewAdminClient ¶
func NewAdminClient(cc grpc.ClientConnInterface) AdminClient
type AdminServer ¶
type AdminServer interface { // RunCommand sends a command to the admin server. RunCommand(context.Context, *RunCommandRequest) (*RunCommandResponse, error) // contains filtered or unexported methods }
AdminServer is the server API for Admin service. All implementations must embed UnimplementedAdminServer for forward compatibility
type RunCommandRequest ¶
type RunCommandRequest struct { CommandName string `protobuf:"bytes,1,opt,name=commandName,proto3" json:"commandName,omitempty"` // Name of the command to run Data *structpb.Struct `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // Arguments to pass to the command // contains filtered or unexported fields }
RunCommandRequest represents an admin command with arguments
func (*RunCommandRequest) Descriptor
deprecated
func (*RunCommandRequest) Descriptor() ([]byte, []int)
Deprecated: Use RunCommandRequest.ProtoReflect.Descriptor instead.
func (*RunCommandRequest) GetCommandName ¶
func (x *RunCommandRequest) GetCommandName() string
func (*RunCommandRequest) GetData ¶
func (x *RunCommandRequest) GetData() *structpb.Struct
func (*RunCommandRequest) ProtoMessage ¶
func (*RunCommandRequest) ProtoMessage()
func (*RunCommandRequest) ProtoReflect ¶
func (x *RunCommandRequest) ProtoReflect() protoreflect.Message
func (*RunCommandRequest) Reset ¶
func (x *RunCommandRequest) Reset()
func (*RunCommandRequest) String ¶
func (x *RunCommandRequest) String() string
type RunCommandResponse ¶
type RunCommandResponse struct {
// contains filtered or unexported fields
}
func (*RunCommandResponse) Descriptor
deprecated
func (*RunCommandResponse) Descriptor() ([]byte, []int)
Deprecated: Use RunCommandResponse.ProtoReflect.Descriptor instead.
func (*RunCommandResponse) ProtoMessage ¶
func (*RunCommandResponse) ProtoMessage()
func (*RunCommandResponse) ProtoReflect ¶
func (x *RunCommandResponse) ProtoReflect() protoreflect.Message
func (*RunCommandResponse) Reset ¶
func (x *RunCommandResponse) Reset()
func (*RunCommandResponse) String ¶
func (x *RunCommandResponse) String() string
type UnimplementedAdminServer ¶
type UnimplementedAdminServer struct { }
UnimplementedAdminServer must be embedded to have forward compatible implementations.
func (UnimplementedAdminServer) RunCommand ¶
func (UnimplementedAdminServer) RunCommand(context.Context, *RunCommandRequest) (*RunCommandResponse, error)
type UnsafeAdminServer ¶
type UnsafeAdminServer interface {
// contains filtered or unexported methods
}
UnsafeAdminServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AdminServer will result in compilation errors.