pb

package
v0.0.0-...-488755c Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2019 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 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) 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 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) Descriptor() ([]byte, []int)

func (*Service) GetCommandline

func (m *Service) GetCommandline() string

func (*Service) GetName

func (m *Service) GetName() string

func (*Service) GetPid

func (m *Service) GetPid() int32

func (*Service) GetStatus

func (m *Service) GetStatus() string

func (*Service) ProtoMessage

func (*Service) ProtoMessage()

func (*Service) Reset

func (m *Service) Reset()

func (*Service) String

func (m *Service) String() string

func (*Service) XXX_DiscardUnknown

func (m *Service) XXX_DiscardUnknown()

func (*Service) XXX_Marshal

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

func (*Service) XXX_Merge

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

func (*Service) XXX_Size

func (m *Service) XXX_Size() int

func (*Service) XXX_Unmarshal

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

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

func (*Services) GetService

func (m *Services) GetService() []*Service

func (*Services) ProtoMessage

func (*Services) ProtoMessage()

func (*Services) Reset

func (m *Services) Reset()

func (*Services) String

func (m *Services) String() string

func (*Services) XXX_DiscardUnknown

func (m *Services) XXX_DiscardUnknown()

func (*Services) XXX_Marshal

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

func (*Services) XXX_Merge

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

func (*Services) XXX_Size

func (m *Services) XXX_Size() int

func (*Services) XXX_Unmarshal

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

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) AllServices

func (*UnimplementedServicesAPIServer) AllServices(ctx context.Context, req *Nope) (*Services, error)

func (*UnimplementedServicesAPIServer) GetService

func (*UnimplementedServicesAPIServer) UpdateService

func (*UnimplementedServicesAPIServer) UpdateService(ctx context.Context, req *NewService) (*Nope, error)

Jump to

Keyboard shortcuts

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