admin

package
v0.25.6 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2022 License: AGPL-3.0 Imports: 17 Imported by: 1

Documentation

Overview

Package admin is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
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)

View Source
var File_admin_admin_proto protoreflect.FileDescriptor

Functions

func RegisterAdminHandler

func RegisterAdminHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

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.Value `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.Value

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 {
	Output *structpb.Value `protobuf:"bytes,1,opt,name=output,proto3" json:"output,omitempty"` // The command output
	// contains filtered or unexported fields
}

RunCommandResponse represents an admin command response

func (*RunCommandResponse) Descriptor deprecated

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

Deprecated: Use RunCommandResponse.ProtoReflect.Descriptor instead.

func (*RunCommandResponse) GetOutput added in v0.23.2

func (x *RunCommandResponse) GetOutput() *structpb.Value

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

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.

Jump to

Keyboard shortcuts

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