Documentation ¶
Overview ¶
Package pb is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- func RegisterServicesAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterServicesAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ServicesAPIClient) error
- func RegisterServicesAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterServicesAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ServicesAPIServer) error
- func RegisterServicesAPIServer(s *grpc.Server, srv ServicesAPIServer)
- type NewService
- func (*NewService) Descriptor() ([]byte, []int)
- func (m *NewService) GetCommandline() string
- func (m *NewService) GetName() string
- func (*NewService) ProtoMessage()
- func (m *NewService) Reset()
- func (m *NewService) String() string
- func (m *NewService) XXX_DiscardUnknown()
- func (m *NewService) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *NewService) XXX_Merge(src proto.Message)
- func (m *NewService) XXX_Size() int
- func (m *NewService) XXX_Unmarshal(b []byte) error
- 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 Service
- func (*Service) Descriptor() ([]byte, []int)
- func (m *Service) GetCommandline() string
- func (m *Service) GetName() string
- func (m *Service) GetPid() int32
- func (m *Service) GetStatus() string
- func (*Service) ProtoMessage()
- func (m *Service) Reset()
- func (m *Service) String() string
- func (m *Service) XXX_DiscardUnknown()
- func (m *Service) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Service) XXX_Merge(src proto.Message)
- func (m *Service) XXX_Size() int
- func (m *Service) XXX_Unmarshal(b []byte) error
- type ServiceName
- func (*ServiceName) Descriptor() ([]byte, []int)
- func (m *ServiceName) GetName() string
- func (*ServiceName) ProtoMessage()
- func (m *ServiceName) Reset()
- func (m *ServiceName) String() string
- func (m *ServiceName) XXX_DiscardUnknown()
- func (m *ServiceName) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ServiceName) XXX_Merge(src proto.Message)
- func (m *ServiceName) XXX_Size() int
- func (m *ServiceName) XXX_Unmarshal(b []byte) error
- type Services
- func (*Services) Descriptor() ([]byte, []int)
- func (m *Services) GetService() []*Service
- func (*Services) ProtoMessage()
- func (m *Services) Reset()
- func (m *Services) String() string
- func (m *Services) XXX_DiscardUnknown()
- func (m *Services) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Services) XXX_Merge(src proto.Message)
- func (m *Services) XXX_Size() int
- func (m *Services) XXX_Unmarshal(b []byte) error
- type ServicesAPIClient
- type ServicesAPIServer
- type UnimplementedServicesAPIServer
- func (*UnimplementedServicesAPIServer) AddService(ctx context.Context, req *NewService) (*Nope, error)
- func (*UnimplementedServicesAPIServer) AllServices(ctx context.Context, req *Nope) (*Services, error)
- func (*UnimplementedServicesAPIServer) GetService(ctx context.Context, req *ServiceName) (*Service, error)
- func (*UnimplementedServicesAPIServer) UpdateService(ctx context.Context, req *NewService) (*Nope, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterServicesAPIHandler ¶
func RegisterServicesAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterServicesAPIHandler registers the http handlers for service ServicesAPI to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterServicesAPIHandlerClient ¶
func RegisterServicesAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ServicesAPIClient) error
RegisterServicesAPIHandlerClient registers the http handlers for service ServicesAPI to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ServicesAPIClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ServicesAPIClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ServicesAPIClient" to call the correct interceptors.
func RegisterServicesAPIHandlerFromEndpoint ¶
func RegisterServicesAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterServicesAPIHandlerFromEndpoint is same as RegisterServicesAPIHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterServicesAPIHandlerServer ¶
func RegisterServicesAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ServicesAPIServer) error
RegisterServicesAPIHandlerServer registers the http handlers for service ServicesAPI to "mux". UnaryRPC :call ServicesAPIServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
func RegisterServicesAPIServer ¶
func RegisterServicesAPIServer(s *grpc.Server, srv ServicesAPIServer)
Types ¶
type NewService ¶
type NewService 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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*NewService) Descriptor ¶
func (*NewService) Descriptor() ([]byte, []int)
func (*NewService) GetCommandline ¶
func (m *NewService) GetCommandline() string
func (*NewService) GetName ¶
func (m *NewService) GetName() string
func (*NewService) ProtoMessage ¶
func (*NewService) ProtoMessage()
func (*NewService) Reset ¶
func (m *NewService) Reset()
func (*NewService) String ¶
func (m *NewService) String() string
func (*NewService) XXX_DiscardUnknown ¶
func (m *NewService) XXX_DiscardUnknown()
func (*NewService) XXX_Marshal ¶
func (m *NewService) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*NewService) XXX_Merge ¶
func (m *NewService) XXX_Merge(src proto.Message)
func (*NewService) XXX_Size ¶
func (m *NewService) XXX_Size() int
func (*NewService) XXX_Unmarshal ¶
func (m *NewService) XXX_Unmarshal(b []byte) error
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 Service ¶
type Service 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"` Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` Pid int32 `protobuf:"varint,4,opt,name=pid,proto3" json:"pid,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Service) Descriptor ¶
func (*Service) GetCommandline ¶
func (*Service) ProtoMessage ¶
func (*Service) ProtoMessage()
func (*Service) XXX_DiscardUnknown ¶
func (m *Service) XXX_DiscardUnknown()
func (*Service) XXX_Marshal ¶
func (*Service) XXX_Unmarshal ¶
type ServiceName ¶
type ServiceName 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 (*ServiceName) Descriptor ¶
func (*ServiceName) Descriptor() ([]byte, []int)
func (*ServiceName) GetName ¶
func (m *ServiceName) GetName() string
func (*ServiceName) ProtoMessage ¶
func (*ServiceName) ProtoMessage()
func (*ServiceName) Reset ¶
func (m *ServiceName) Reset()
func (*ServiceName) String ¶
func (m *ServiceName) String() string
func (*ServiceName) XXX_DiscardUnknown ¶
func (m *ServiceName) XXX_DiscardUnknown()
func (*ServiceName) XXX_Marshal ¶
func (m *ServiceName) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ServiceName) XXX_Merge ¶
func (m *ServiceName) XXX_Merge(src proto.Message)
func (*ServiceName) XXX_Size ¶
func (m *ServiceName) XXX_Size() int
func (*ServiceName) XXX_Unmarshal ¶
func (m *ServiceName) XXX_Unmarshal(b []byte) error
type Services ¶
type Services struct { Service []*Service `protobuf:"bytes,1,rep,name=service,proto3" json:"service,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Services contains service names.
func (*Services) Descriptor ¶
func (*Services) GetService ¶
func (*Services) ProtoMessage ¶
func (*Services) ProtoMessage()
func (*Services) XXX_DiscardUnknown ¶
func (m *Services) XXX_DiscardUnknown()
func (*Services) XXX_Marshal ¶
func (*Services) XXX_Unmarshal ¶
type ServicesAPIClient ¶
type ServicesAPIClient interface { // AddService adds service. AddService(ctx context.Context, in *NewService, opts ...grpc.CallOption) (*Nope, error) // UpdateService updates service. UpdateService(ctx context.Context, in *NewService, opts ...grpc.CallOption) (*Nope, error) // AllServices returns all registered services. AllServices(ctx context.Context, in *Nope, opts ...grpc.CallOption) (*Services, error) // GetService returns service description for provided name. GetService(ctx context.Context, in *ServiceName, opts ...grpc.CallOption) (*Service, error) }
ServicesAPIClient is the client API for ServicesAPI service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewServicesAPIClient ¶
func NewServicesAPIClient(cc *grpc.ClientConn) ServicesAPIClient
type ServicesAPIServer ¶
type ServicesAPIServer interface { // AddService adds service. AddService(context.Context, *NewService) (*Nope, error) // UpdateService updates service. UpdateService(context.Context, *NewService) (*Nope, error) // AllServices returns all registered services. AllServices(context.Context, *Nope) (*Services, error) // GetService returns service description for provided name. GetService(context.Context, *ServiceName) (*Service, error) }
ServicesAPIServer is the server API for ServicesAPI service.
type UnimplementedServicesAPIServer ¶
type UnimplementedServicesAPIServer struct { }
UnimplementedServicesAPIServer can be embedded to have forward compatible implementations.
func (*UnimplementedServicesAPIServer) AddService ¶
func (*UnimplementedServicesAPIServer) AddService(ctx context.Context, req *NewService) (*Nope, error)
func (*UnimplementedServicesAPIServer) AllServices ¶
func (*UnimplementedServicesAPIServer) GetService ¶
func (*UnimplementedServicesAPIServer) GetService(ctx context.Context, req *ServiceName) (*Service, error)
func (*UnimplementedServicesAPIServer) UpdateService ¶
func (*UnimplementedServicesAPIServer) UpdateService(ctx context.Context, req *NewService) (*Nope, error)