pb

package
v0.0.0-...-73375e4 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package pb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

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) Descriptor() ([]byte, []int)

func (*Nope) ProtoMessage

func (*Nope) ProtoMessage()

func (*Nope) Reset

func (m *Nope) Reset()

func (*Nope) String

func (m *Nope) String() string

func (*Nope) XXX_DiscardUnknown

func (m *Nope) XXX_DiscardUnknown()

func (*Nope) XXX_Marshal

func (m *Nope) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Nope) XXX_Merge

func (m *Nope) XXX_Merge(src proto.Message)

func (*Nope) XXX_Size

func (m *Nope) XXX_Size() int

func (*Nope) XXX_Unmarshal

func (m *Nope) XXX_Unmarshal(b []byte) error

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) Descriptor() ([]byte, []int)

func (*ProcEnv) GetEnvVars

func (m *ProcEnv) GetEnvVars() []string

func (*ProcEnv) GetWorkingDir

func (m *ProcEnv) GetWorkingDir() string

func (*ProcEnv) ProtoMessage

func (*ProcEnv) ProtoMessage()

func (*ProcEnv) Reset

func (m *ProcEnv) Reset()

func (*ProcEnv) String

func (m *ProcEnv) String() string

func (*ProcEnv) XXX_DiscardUnknown

func (m *ProcEnv) XXX_DiscardUnknown()

func (*ProcEnv) XXX_Marshal

func (m *ProcEnv) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ProcEnv) XXX_Merge

func (m *ProcEnv) XXX_Merge(src proto.Message)

func (*ProcEnv) XXX_Size

func (m *ProcEnv) XXX_Size() int

func (*ProcEnv) XXX_Unmarshal

func (m *ProcEnv) XXX_Unmarshal(b []byte) error

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) Descriptor() ([]byte, []int)

func (*ProcName) GetName

func (m *ProcName) GetName() string

func (*ProcName) ProtoMessage

func (*ProcName) ProtoMessage()

func (*ProcName) Reset

func (m *ProcName) Reset()

func (*ProcName) String

func (m *ProcName) String() string

func (*ProcName) XXX_DiscardUnknown

func (m *ProcName) XXX_DiscardUnknown()

func (*ProcName) XXX_Marshal

func (m *ProcName) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ProcName) XXX_Merge

func (m *ProcName) XXX_Merge(src proto.Message)

func (*ProcName) XXX_Size

func (m *ProcName) XXX_Size() int

func (*ProcName) XXX_Unmarshal

func (m *ProcName) XXX_Unmarshal(b []byte) error

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) Descriptor() ([]byte, []int)

func (*Process) GetCommandLine

func (m *Process) GetCommandLine() string

func (*Process) GetLoggerCommandLine

func (m *Process) GetLoggerCommandLine() string

func (*Process) GetName

func (m *Process) GetName() string

func (*Process) ProtoMessage

func (*Process) ProtoMessage()

func (*Process) Reset

func (m *Process) Reset()

func (*Process) String

func (m *Process) String() string

func (*Process) XXX_DiscardUnknown

func (m *Process) XXX_DiscardUnknown()

func (*Process) XXX_Marshal

func (m *Process) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Process) XXX_Merge

func (m *Process) XXX_Merge(src proto.Message)

func (*Process) XXX_Size

func (m *Process) XXX_Size() int

func (*Process) XXX_Unmarshal

func (m *Process) XXX_Unmarshal(b []byte) error

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) Descriptor() ([]byte, []int)

func (*Result) GetDescription

func (m *Result) GetDescription() string

func (*Result) ProtoMessage

func (*Result) ProtoMessage()

func (*Result) Reset

func (m *Result) Reset()

func (*Result) String

func (m *Result) String() string

func (*Result) XXX_DiscardUnknown

func (m *Result) XXX_DiscardUnknown()

func (*Result) XXX_Marshal

func (m *Result) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Result) XXX_Merge

func (m *Result) XXX_Merge(src proto.Message)

func (*Result) XXX_Size

func (m *Result) XXX_Size() int

func (*Result) XXX_Unmarshal

func (m *Result) XXX_Unmarshal(b []byte) error

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) Descriptor() ([]byte, []int)

func (*SetProc) GetCreate

func (m *SetProc) GetCreate() bool

func (*SetProc) GetEnv

func (m *SetProc) GetEnv() *ProcEnv

func (*SetProc) GetProcess

func (m *SetProc) GetProcess() *Process

func (*SetProc) ProtoMessage

func (*SetProc) ProtoMessage()

func (*SetProc) Reset

func (m *SetProc) Reset()

func (*SetProc) String

func (m *SetProc) String() string

func (*SetProc) XXX_DiscardUnknown

func (m *SetProc) XXX_DiscardUnknown()

func (*SetProc) XXX_Marshal

func (m *SetProc) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SetProc) XXX_Merge

func (m *SetProc) XXX_Merge(src proto.Message)

func (*SetProc) XXX_Size

func (m *SetProc) XXX_Size() int

func (*SetProc) XXX_Unmarshal

func (m *SetProc) XXX_Unmarshal(b []byte) error

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) Descriptor() ([]byte, []int)

func (*Signal) GetName

func (m *Signal) GetName() string

func (*Signal) GetSignal

func (m *Signal) GetSignal() int32

func (*Signal) ProtoMessage

func (*Signal) ProtoMessage()

func (*Signal) Reset

func (m *Signal) Reset()

func (*Signal) String

func (m *Signal) String() string

func (*Signal) XXX_DiscardUnknown

func (m *Signal) XXX_DiscardUnknown()

func (*Signal) XXX_Marshal

func (m *Signal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Signal) XXX_Merge

func (m *Signal) XXX_Merge(src proto.Message)

func (*Signal) XXX_Size

func (m *Signal) XXX_Size() int

func (*Signal) XXX_Unmarshal

func (m *Signal) XXX_Unmarshal(b []byte) error

type UnimplementedControlAPIServer

type UnimplementedControlAPIServer struct {
}

UnimplementedControlAPIServer can be embedded to have forward compatible implementations.

func (*UnimplementedControlAPIServer) AddProcess

func (*UnimplementedControlAPIServer) AllProcesses

func (*UnimplementedControlAPIServer) DeleteProcess

func (*UnimplementedControlAPIServer) DeleteProcess(ctx context.Context, req *ProcName) (*Result, error)

func (*UnimplementedControlAPIServer) GetProcess

func (*UnimplementedControlAPIServer) Halt

func (*UnimplementedControlAPIServer) LoggerSignal

func (*UnimplementedControlAPIServer) LoggerSignal(ctx context.Context, req *Signal) (*Result, error)

func (*UnimplementedControlAPIServer) ProcessSignal

func (*UnimplementedControlAPIServer) ProcessSignal(ctx context.Context, req *Signal) (*Result, error)

func (*UnimplementedControlAPIServer) UpdateProcess

func (*UnimplementedControlAPIServer) UpdateProcess(ctx context.Context, req *SetProc) (*ProcStatus, error)

Jump to

Keyboard shortcuts

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