Documentation ¶
Overview ¶
Package pb is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- func RegisterControlAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterControlAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ControlAPIClient) error
- func RegisterControlAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterControlAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ControlAPIServer) error
- func RegisterControlAPIServer(s *grpc.Server, srv ControlAPIServer)
- type ControlAPIClient
- type ControlAPIServer
- type Nope
- func (*Nope) Descriptor() ([]byte, []int)
- func (*Nope) ProtoMessage()
- func (m *Nope) Reset()
- func (m *Nope) String() string
- func (m *Nope) XXX_DiscardUnknown()
- func (m *Nope) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Nope) XXX_Merge(src proto.Message)
- func (m *Nope) XXX_Size() int
- func (m *Nope) XXX_Unmarshal(b []byte) error
- type ProcEnv
- func (*ProcEnv) Descriptor() ([]byte, []int)
- func (m *ProcEnv) GetEnvVars() []string
- func (m *ProcEnv) GetWorkingDir() string
- func (*ProcEnv) ProtoMessage()
- func (m *ProcEnv) Reset()
- func (m *ProcEnv) String() string
- func (m *ProcEnv) XXX_DiscardUnknown()
- func (m *ProcEnv) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ProcEnv) XXX_Merge(src proto.Message)
- func (m *ProcEnv) XXX_Size() int
- func (m *ProcEnv) XXX_Unmarshal(b []byte) error
- type ProcName
- func (*ProcName) Descriptor() ([]byte, []int)
- func (m *ProcName) GetName() string
- func (*ProcName) ProtoMessage()
- func (m *ProcName) Reset()
- func (m *ProcName) String() string
- func (m *ProcName) XXX_DiscardUnknown()
- func (m *ProcName) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ProcName) XXX_Merge(src proto.Message)
- func (m *ProcName) XXX_Size() int
- func (m *ProcName) XXX_Unmarshal(b []byte) error
- type ProcStatus
- func (*ProcStatus) Descriptor() ([]byte, []int)
- func (m *ProcStatus) GetExited() bool
- func (m *ProcStatus) GetPid() int32
- func (m *ProcStatus) GetProcess() *Process
- func (m *ProcStatus) GetState() string
- func (*ProcStatus) ProtoMessage()
- func (m *ProcStatus) Reset()
- func (m *ProcStatus) String() string
- func (m *ProcStatus) XXX_DiscardUnknown()
- func (m *ProcStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ProcStatus) XXX_Merge(src proto.Message)
- func (m *ProcStatus) XXX_Size() int
- func (m *ProcStatus) XXX_Unmarshal(b []byte) error
- type Process
- func (*Process) Descriptor() ([]byte, []int)
- func (m *Process) GetCommandLine() string
- func (m *Process) GetLoggerCommandLine() string
- func (m *Process) GetName() string
- func (*Process) ProtoMessage()
- func (m *Process) Reset()
- func (m *Process) String() string
- func (m *Process) XXX_DiscardUnknown()
- func (m *Process) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Process) XXX_Merge(src proto.Message)
- func (m *Process) XXX_Size() int
- func (m *Process) XXX_Unmarshal(b []byte) error
- type ProcessesStatus
- func (*ProcessesStatus) Descriptor() ([]byte, []int)
- func (m *ProcessesStatus) GetStatuses() []*ProcStatus
- func (*ProcessesStatus) ProtoMessage()
- func (m *ProcessesStatus) Reset()
- func (m *ProcessesStatus) String() string
- func (m *ProcessesStatus) XXX_DiscardUnknown()
- func (m *ProcessesStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ProcessesStatus) XXX_Merge(src proto.Message)
- func (m *ProcessesStatus) XXX_Size() int
- func (m *ProcessesStatus) XXX_Unmarshal(b []byte) error
- type Result
- func (*Result) Descriptor() ([]byte, []int)
- func (m *Result) GetDescription() string
- func (*Result) ProtoMessage()
- func (m *Result) Reset()
- func (m *Result) String() string
- func (m *Result) XXX_DiscardUnknown()
- func (m *Result) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Result) XXX_Merge(src proto.Message)
- func (m *Result) XXX_Size() int
- func (m *Result) XXX_Unmarshal(b []byte) error
- type SetProc
- func (*SetProc) Descriptor() ([]byte, []int)
- func (m *SetProc) GetCreate() bool
- func (m *SetProc) GetEnv() *ProcEnv
- func (m *SetProc) GetProcess() *Process
- func (*SetProc) ProtoMessage()
- func (m *SetProc) Reset()
- func (m *SetProc) String() string
- func (m *SetProc) XXX_DiscardUnknown()
- func (m *SetProc) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *SetProc) XXX_Merge(src proto.Message)
- func (m *SetProc) XXX_Size() int
- func (m *SetProc) XXX_Unmarshal(b []byte) error
- type Signal
- func (*Signal) Descriptor() ([]byte, []int)
- func (m *Signal) GetName() string
- func (m *Signal) GetSignal() int32
- func (*Signal) ProtoMessage()
- func (m *Signal) Reset()
- func (m *Signal) String() string
- func (m *Signal) XXX_DiscardUnknown()
- func (m *Signal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Signal) XXX_Merge(src proto.Message)
- func (m *Signal) XXX_Size() int
- func (m *Signal) XXX_Unmarshal(b []byte) error
- type UnimplementedControlAPIServer
- func (*UnimplementedControlAPIServer) AddProcess(ctx context.Context, req *SetProc) (*ProcStatus, error)
- func (*UnimplementedControlAPIServer) AllProcesses(ctx context.Context, req *Nope) (*ProcessesStatus, error)
- func (*UnimplementedControlAPIServer) DeleteProcess(ctx context.Context, req *ProcName) (*Result, error)
- func (*UnimplementedControlAPIServer) GetProcess(ctx context.Context, req *ProcName) (*ProcStatus, error)
- func (*UnimplementedControlAPIServer) Halt(ctx context.Context, req *Nope) (*Result, error)
- func (*UnimplementedControlAPIServer) LoggerSignal(ctx context.Context, req *Signal) (*Result, error)
- func (*UnimplementedControlAPIServer) ProcessSignal(ctx context.Context, req *Signal) (*Result, error)
- func (*UnimplementedControlAPIServer) UpdateProcess(ctx context.Context, req *SetProc) (*ProcStatus, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterControlAPIHandler ¶
func RegisterControlAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterControlAPIHandler registers the http handlers for service ControlAPI to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterControlAPIHandlerClient ¶
func RegisterControlAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ControlAPIClient) error
RegisterControlAPIHandlerClient registers the http handlers for service ControlAPI to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ControlAPIClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ControlAPIClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ControlAPIClient" to call the correct interceptors.
func RegisterControlAPIHandlerFromEndpoint ¶
func RegisterControlAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterControlAPIHandlerFromEndpoint is same as RegisterControlAPIHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterControlAPIHandlerServer ¶
func RegisterControlAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ControlAPIServer) error
RegisterControlAPIHandlerServer registers the http handlers for service ControlAPI to "mux". UnaryRPC :call ControlAPIServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
func RegisterControlAPIServer ¶
func RegisterControlAPIServer(s *grpc.Server, srv ControlAPIServer)
Types ¶
type ControlAPIClient ¶
type ControlAPIClient interface { // LoggerSignal send signal to logger. LoggerSignal(ctx context.Context, in *Signal, opts ...grpc.CallOption) (*Result, error) // CommandSignal send signal to process. ProcessSignal(ctx context.Context, in *Signal, opts ...grpc.CallOption) (*Result, error) // AllProcesses returns all registered processes. AllProcesses(ctx context.Context, in *Nope, opts ...grpc.CallOption) (*ProcessesStatus, error) // Halt stops supervisor. Halt(ctx context.Context, in *Nope, opts ...grpc.CallOption) (*Result, error) // AddProcess adds process. AddProcess(ctx context.Context, in *SetProc, opts ...grpc.CallOption) (*ProcStatus, error) // UpdateProcess updates process. UpdateProcess(ctx context.Context, in *SetProc, opts ...grpc.CallOption) (*ProcStatus, error) // DeleteProcess deletes process. DeleteProcess(ctx context.Context, in *ProcName, opts ...grpc.CallOption) (*Result, error) // GetProcess returns process status by name. GetProcess(ctx context.Context, in *ProcName, opts ...grpc.CallOption) (*ProcStatus, error) }
ControlAPIClient is the client API for ControlAPI service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewControlAPIClient ¶
func NewControlAPIClient(cc *grpc.ClientConn) ControlAPIClient
type ControlAPIServer ¶
type ControlAPIServer interface { // LoggerSignal send signal to logger. LoggerSignal(context.Context, *Signal) (*Result, error) // CommandSignal send signal to process. ProcessSignal(context.Context, *Signal) (*Result, error) // AllProcesses returns all registered processes. AllProcesses(context.Context, *Nope) (*ProcessesStatus, error) // Halt stops supervisor. Halt(context.Context, *Nope) (*Result, error) // AddProcess adds process. AddProcess(context.Context, *SetProc) (*ProcStatus, error) // UpdateProcess updates process. UpdateProcess(context.Context, *SetProc) (*ProcStatus, error) // DeleteProcess deletes process. DeleteProcess(context.Context, *ProcName) (*Result, error) // GetProcess returns process status by name. GetProcess(context.Context, *ProcName) (*ProcStatus, error) }
ControlAPIServer is the server API for ControlAPI service.
type Nope ¶
type Nope struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Nope) Descriptor ¶
func (*Nope) ProtoMessage ¶
func (*Nope) ProtoMessage()
func (*Nope) XXX_DiscardUnknown ¶
func (m *Nope) XXX_DiscardUnknown()
func (*Nope) XXX_Unmarshal ¶
type ProcEnv ¶
type ProcEnv struct { EnvVars []string `protobuf:"bytes,1,rep,name=envVars,proto3" json:"envVars,omitempty"` WorkingDir string `protobuf:"bytes,2,opt,name=workingDir,proto3" json:"workingDir,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ProcEnv) Descriptor ¶
func (*ProcEnv) GetEnvVars ¶
func (*ProcEnv) GetWorkingDir ¶
func (*ProcEnv) ProtoMessage ¶
func (*ProcEnv) ProtoMessage()
func (*ProcEnv) XXX_DiscardUnknown ¶
func (m *ProcEnv) XXX_DiscardUnknown()
func (*ProcEnv) XXX_Marshal ¶
func (*ProcEnv) XXX_Unmarshal ¶
type ProcName ¶
type ProcName struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ProcName) Descriptor ¶
func (*ProcName) ProtoMessage ¶
func (*ProcName) ProtoMessage()
func (*ProcName) XXX_DiscardUnknown ¶
func (m *ProcName) XXX_DiscardUnknown()
func (*ProcName) XXX_Marshal ¶
func (*ProcName) XXX_Unmarshal ¶
type ProcStatus ¶
type ProcStatus struct { Pid int32 `protobuf:"varint,1,opt,name=pid,proto3" json:"pid,omitempty"` State string `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"` Process *Process `protobuf:"bytes,3,opt,name=process,proto3" json:"process,omitempty"` Exited bool `protobuf:"varint,4,opt,name=exited,proto3" json:"exited,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ProcStatus) Descriptor ¶
func (*ProcStatus) Descriptor() ([]byte, []int)
func (*ProcStatus) GetExited ¶
func (m *ProcStatus) GetExited() bool
func (*ProcStatus) GetPid ¶
func (m *ProcStatus) GetPid() int32
func (*ProcStatus) GetProcess ¶
func (m *ProcStatus) GetProcess() *Process
func (*ProcStatus) GetState ¶
func (m *ProcStatus) GetState() string
func (*ProcStatus) ProtoMessage ¶
func (*ProcStatus) ProtoMessage()
func (*ProcStatus) Reset ¶
func (m *ProcStatus) Reset()
func (*ProcStatus) String ¶
func (m *ProcStatus) String() string
func (*ProcStatus) XXX_DiscardUnknown ¶
func (m *ProcStatus) XXX_DiscardUnknown()
func (*ProcStatus) XXX_Marshal ¶
func (m *ProcStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ProcStatus) XXX_Merge ¶
func (m *ProcStatus) XXX_Merge(src proto.Message)
func (*ProcStatus) XXX_Size ¶
func (m *ProcStatus) XXX_Size() int
func (*ProcStatus) XXX_Unmarshal ¶
func (m *ProcStatus) XXX_Unmarshal(b []byte) error
type Process ¶
type Process struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` CommandLine string `protobuf:"bytes,2,opt,name=commandLine,proto3" json:"commandLine,omitempty"` LoggerCommandLine string `protobuf:"bytes,3,opt,name=loggerCommandLine,proto3" json:"loggerCommandLine,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Process) Descriptor ¶
func (*Process) GetCommandLine ¶
func (*Process) GetLoggerCommandLine ¶
func (*Process) ProtoMessage ¶
func (*Process) ProtoMessage()
func (*Process) XXX_DiscardUnknown ¶
func (m *Process) XXX_DiscardUnknown()
func (*Process) XXX_Marshal ¶
func (*Process) XXX_Unmarshal ¶
type ProcessesStatus ¶
type ProcessesStatus struct { Statuses []*ProcStatus `protobuf:"bytes,1,rep,name=statuses,proto3" json:"statuses,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
ProcessesStatus contains processes statuses.
func (*ProcessesStatus) Descriptor ¶
func (*ProcessesStatus) Descriptor() ([]byte, []int)
func (*ProcessesStatus) GetStatuses ¶
func (m *ProcessesStatus) GetStatuses() []*ProcStatus
func (*ProcessesStatus) ProtoMessage ¶
func (*ProcessesStatus) ProtoMessage()
func (*ProcessesStatus) Reset ¶
func (m *ProcessesStatus) Reset()
func (*ProcessesStatus) String ¶
func (m *ProcessesStatus) String() string
func (*ProcessesStatus) XXX_DiscardUnknown ¶
func (m *ProcessesStatus) XXX_DiscardUnknown()
func (*ProcessesStatus) XXX_Marshal ¶
func (m *ProcessesStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ProcessesStatus) XXX_Merge ¶
func (m *ProcessesStatus) XXX_Merge(src proto.Message)
func (*ProcessesStatus) XXX_Size ¶
func (m *ProcessesStatus) XXX_Size() int
func (*ProcessesStatus) XXX_Unmarshal ¶
func (m *ProcessesStatus) XXX_Unmarshal(b []byte) error
type Result ¶
type Result struct { Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Result) Descriptor ¶
func (*Result) GetDescription ¶
func (*Result) ProtoMessage ¶
func (*Result) ProtoMessage()
func (*Result) XXX_DiscardUnknown ¶
func (m *Result) XXX_DiscardUnknown()
func (*Result) XXX_Marshal ¶
func (*Result) XXX_Unmarshal ¶
type SetProc ¶
type SetProc struct { Create bool `protobuf:"varint,1,opt,name=create,proto3" json:"create,omitempty"` Process *Process `protobuf:"bytes,2,opt,name=process,proto3" json:"process,omitempty"` Env *ProcEnv `protobuf:"bytes,3,opt,name=env,proto3" json:"env,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*SetProc) Descriptor ¶
func (*SetProc) GetProcess ¶
func (*SetProc) ProtoMessage ¶
func (*SetProc) ProtoMessage()
func (*SetProc) XXX_DiscardUnknown ¶
func (m *SetProc) XXX_DiscardUnknown()
func (*SetProc) XXX_Marshal ¶
func (*SetProc) XXX_Unmarshal ¶
type Signal ¶
type Signal struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Signal int32 `protobuf:"varint,2,opt,name=signal,proto3" json:"signal,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Signal) Descriptor ¶
func (*Signal) ProtoMessage ¶
func (*Signal) ProtoMessage()
func (*Signal) XXX_DiscardUnknown ¶
func (m *Signal) XXX_DiscardUnknown()
func (*Signal) XXX_Marshal ¶
func (*Signal) XXX_Unmarshal ¶
type UnimplementedControlAPIServer ¶
type UnimplementedControlAPIServer struct { }
UnimplementedControlAPIServer can be embedded to have forward compatible implementations.
func (*UnimplementedControlAPIServer) AddProcess ¶
func (*UnimplementedControlAPIServer) AddProcess(ctx context.Context, req *SetProc) (*ProcStatus, error)
func (*UnimplementedControlAPIServer) AllProcesses ¶
func (*UnimplementedControlAPIServer) AllProcesses(ctx context.Context, req *Nope) (*ProcessesStatus, error)
func (*UnimplementedControlAPIServer) DeleteProcess ¶
func (*UnimplementedControlAPIServer) GetProcess ¶
func (*UnimplementedControlAPIServer) GetProcess(ctx context.Context, req *ProcName) (*ProcStatus, error)
func (*UnimplementedControlAPIServer) LoggerSignal ¶
func (*UnimplementedControlAPIServer) ProcessSignal ¶
func (*UnimplementedControlAPIServer) UpdateProcess ¶
func (*UnimplementedControlAPIServer) UpdateProcess(ctx context.Context, req *SetProc) (*ProcStatus, error)