info

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package info is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_info_info_proto protoreflect.FileDescriptor

Functions

func RegisterInfoHandler

func RegisterInfoHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterInfoHandler registers the http handlers for service Info to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterInfoHandlerClient

func RegisterInfoHandlerClient(ctx context.Context, mux *runtime.ServeMux, client InfoClient) error

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

func RegisterInfoHandlerServer(ctx context.Context, mux *runtime.ServeMux, server InfoServer) error

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

Deprecated: Use Health.ProtoReflect.Descriptor instead.

func (*Health) GetAlive

func (x *Health) GetAlive() bool

func (*Health) ProtoMessage

func (*Health) ProtoMessage()

func (*Health) ProtoReflect added in v0.1.4

func (x *Health) ProtoReflect() protoreflect.Message

func (*Health) Reset

func (x *Health) Reset()

func (*Health) String

func (x *Health) String() string

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

Deprecated: Use Report.ProtoReflect.Descriptor instead.

func (*Report) GetDate

func (x *Report) GetDate() string

func (*Report) GetRepo

func (x *Report) GetRepo() string

func (*Report) GetVersion

func (x *Report) GetVersion() string

func (*Report) ProtoMessage

func (*Report) ProtoMessage()

func (*Report) ProtoReflect added in v0.1.4

func (x *Report) ProtoReflect() protoreflect.Message

func (*Report) Reset

func (x *Report) Reset()

func (*Report) String

func (x *Report) String() string

type UnimplementedInfoServer

type UnimplementedInfoServer struct {
}

UnimplementedInfoServer can be embedded to have forward compatible implementations.

func (*UnimplementedInfoServer) GetHealth

func (*UnimplementedInfoServer) GetInfo

Jump to

Keyboard shortcuts

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