Documentation ¶
Overview ¶
Package info is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterInfoHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterInfoHandlerClient(ctx context.Context, mux *runtime.ServeMux, client InfoClient) error
- func RegisterInfoHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterInfoHandlerServer(ctx context.Context, mux *runtime.ServeMux, server InfoServer) error
- func RegisterInfoServer(s *grpc.Server, srv InfoServer)
- type Health
- type InfoClient
- type InfoServer
- type Report
- type UnimplementedInfoServer
Constants ¶
This section is empty.
Variables ¶
var File_info_info_proto protoreflect.FileDescriptor
Functions ¶
func RegisterInfoHandler ¶
RegisterInfoHandler registers the http handlers for service Info to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterInfoHandlerClient ¶
RegisterInfoHandlerClient registers the http handlers for service Info to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "InfoClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "InfoClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "InfoClient" to call the correct interceptors.
func RegisterInfoHandlerFromEndpoint ¶
func RegisterInfoHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterInfoHandlerFromEndpoint is same as RegisterInfoHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterInfoHandlerServer ¶
RegisterInfoHandlerServer registers the http handlers for service Info to "mux". UnaryRPC :call InfoServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
func RegisterInfoServer ¶
func RegisterInfoServer(s *grpc.Server, srv InfoServer)
Types ¶
type Health ¶
type Health struct { // Health state. Alive bool `protobuf:"varint,1,opt,name=alive,proto3" json:"alive,omitempty"` // contains filtered or unexported fields }
A Health report about the service.
func (*Health) Descriptor
deprecated
func (*Health) ProtoMessage ¶
func (*Health) ProtoMessage()
func (*Health) ProtoReflect ¶ added in v0.1.4
func (x *Health) ProtoReflect() protoreflect.Message
type InfoClient ¶
type InfoClient interface { // Get an information about the service. GetInfo(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Report, error) // Get a health information for the service. GetHealth(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Health, error) }
InfoClient is the client API for Info service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewInfoClient ¶
func NewInfoClient(cc grpc.ClientConnInterface) InfoClient
type InfoServer ¶
type InfoServer interface { // Get an information about the service. GetInfo(context.Context, *empty.Empty) (*Report, error) // Get a health information for the service. GetHealth(context.Context, *empty.Empty) (*Health, error) }
InfoServer is the server API for Info service.
type Report ¶
type Report struct { // Version of the service. Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` // Build date of the service. Date string `protobuf:"bytes,2,opt,name=date,proto3" json:"date,omitempty"` // Repository name. Repo string `protobuf:"bytes,3,opt,name=repo,proto3" json:"repo,omitempty"` // contains filtered or unexported fields }
A Report about the service.
func (*Report) Descriptor
deprecated
func (*Report) GetVersion ¶
func (*Report) ProtoMessage ¶
func (*Report) ProtoMessage()
func (*Report) ProtoReflect ¶ added in v0.1.4
func (x *Report) ProtoReflect() protoreflect.Message
type UnimplementedInfoServer ¶
type UnimplementedInfoServer struct { }
UnimplementedInfoServer can be embedded to have forward compatible implementations.