Search and commands

↑ ↓ to select · Enter to open · Esc to close

Type to search packages.

info

v0.1.8
github.com/takama/grpc/contracts/info

Documentation

pkg.go.dev ↗

Table of contents

↓ to select · Enter to jump· Shift+Enter for source

31 matches

Top ↑

Package info is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Variables

File_info_info_proto

var File_info_info_proto protoreflect.FileDescriptor

Functions

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".

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.

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.

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.

RegisterInfoServer

func RegisterInfoServer(s *grpc.Server, srv InfoServer)

Types

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.

Health.Descriptor

func (*Health) Descriptor() ([]byte, []int)

Deprecated: Use Health.ProtoReflect.Descriptor instead.

Health.GetAlive

func (x *Health) GetAlive() bool

Health.ProtoMessage

func (*Health) ProtoMessage()

Health.ProtoReflect

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

Health.Reset

func (x *Health) Reset()

Health.String

func (x *Health) String() string

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.

NewInfoClient

func NewInfoClient(cc grpc.ClientConnInterface) InfoClient

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.

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.

Report.Descriptor

func (*Report) Descriptor() ([]byte, []int)

Deprecated: Use Report.ProtoReflect.Descriptor instead.

Report.GetDate

func (x *Report) GetDate() string

Report.GetRepo

func (x *Report) GetRepo() string

Report.GetVersion

func (x *Report) GetVersion() string

Report.ProtoMessage

func (*Report) ProtoMessage()

Report.ProtoReflect

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

Report.Reset

func (x *Report) Reset()

Report.String

func (x *Report) String() string

UnimplementedInfoServer

type UnimplementedInfoServer struct {
}

UnimplementedInfoServer can be embedded to have forward compatible implementations.

UnimplementedInfoServer.GetHealth

func (*UnimplementedInfoServer) GetHealth(context.Context, *empty.Empty) (*Health, error)

UnimplementedInfoServer.GetInfo

func (*UnimplementedInfoServer) GetInfo(context.Context, *empty.Empty) (*Report, error)

Dependency graph