grpc_health_v1

package
v0.0.0-...-a45743d Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package grpc_health_v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var HealthCheckResponse_ServingStatus_name = map[int32]string{
	0: "UNKNOWN",
	1: "SERVING",
	2: "NOT_SERVING",
	3: "SERVICE_UNKNOWN",
}
View Source
var HealthCheckResponse_ServingStatus_value = map[string]int32{
	"UNKNOWN":         0,
	"SERVING":         1,
	"NOT_SERVING":     2,
	"SERVICE_UNKNOWN": 3,
}

Functions

func RegisterHealthHandler

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

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

func RegisterHealthHandlerClient

func RegisterHealthHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HealthClient) error

RegisterHealthHandlerClient registers the http handlers for service Health to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "HealthClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "HealthClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "HealthClient" to call the correct interceptors.

func RegisterHealthHandlerFromEndpoint

func RegisterHealthHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterHealthHandlerFromEndpoint is same as RegisterHealthHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterHealthHandlerServer

func RegisterHealthHandlerServer(ctx context.Context, mux *runtime.ServeMux, server HealthServer) error

RegisterHealthHandlerServer registers the http handlers for service Health to "mux". UnaryRPC :call HealthServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.

func RegisterHealthServer

func RegisterHealthServer(s *grpc.Server, srv HealthServer)

Types

type HealthCheckRequest

type HealthCheckRequest struct {
	Service              string   `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*HealthCheckRequest) Descriptor

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

func (*HealthCheckRequest) GetService

func (m *HealthCheckRequest) GetService() string

func (*HealthCheckRequest) ProtoMessage

func (*HealthCheckRequest) ProtoMessage()

func (*HealthCheckRequest) Reset

func (m *HealthCheckRequest) Reset()

func (*HealthCheckRequest) String

func (m *HealthCheckRequest) String() string

func (*HealthCheckRequest) XXX_DiscardUnknown

func (m *HealthCheckRequest) XXX_DiscardUnknown()

func (*HealthCheckRequest) XXX_Marshal

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

func (*HealthCheckRequest) XXX_Merge

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

func (*HealthCheckRequest) XXX_Size

func (m *HealthCheckRequest) XXX_Size() int

func (*HealthCheckRequest) XXX_Unmarshal

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

type HealthCheckResponse

type HealthCheckResponse struct {
	Status               HealthCheckResponse_ServingStatus `protobuf:"varint,1,opt,name=status,proto3,enum=grpc.health.v1.HealthCheckResponse_ServingStatus" json:"status,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                          `json:"-"`
	XXX_unrecognized     []byte                            `json:"-"`
	XXX_sizecache        int32                             `json:"-"`
}

func (*HealthCheckResponse) Descriptor

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

func (*HealthCheckResponse) GetStatus

func (*HealthCheckResponse) ProtoMessage

func (*HealthCheckResponse) ProtoMessage()

func (*HealthCheckResponse) Reset

func (m *HealthCheckResponse) Reset()

func (*HealthCheckResponse) String

func (m *HealthCheckResponse) String() string

func (*HealthCheckResponse) XXX_DiscardUnknown

func (m *HealthCheckResponse) XXX_DiscardUnknown()

func (*HealthCheckResponse) XXX_Marshal

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

func (*HealthCheckResponse) XXX_Merge

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

func (*HealthCheckResponse) XXX_Size

func (m *HealthCheckResponse) XXX_Size() int

func (*HealthCheckResponse) XXX_Unmarshal

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

type HealthCheckResponse_ServingStatus

type HealthCheckResponse_ServingStatus int32
const (
	HealthCheckResponse_UNKNOWN         HealthCheckResponse_ServingStatus = 0
	HealthCheckResponse_SERVING         HealthCheckResponse_ServingStatus = 1
	HealthCheckResponse_NOT_SERVING     HealthCheckResponse_ServingStatus = 2
	HealthCheckResponse_SERVICE_UNKNOWN HealthCheckResponse_ServingStatus = 3
)

func (HealthCheckResponse_ServingStatus) EnumDescriptor

func (HealthCheckResponse_ServingStatus) EnumDescriptor() ([]byte, []int)

func (HealthCheckResponse_ServingStatus) String

type HealthClient

type HealthClient interface {
	Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error)
	Watch(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (Health_WatchClient, error)
}

HealthClient is the client API for Health service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewHealthClient

func NewHealthClient(cc grpc.ClientConnInterface) HealthClient

type HealthServer

HealthServer is the server API for Health service.

type Health_WatchClient

type Health_WatchClient interface {
	Recv() (*HealthCheckResponse, error)
	grpc.ClientStream
}

type Health_WatchServer

type Health_WatchServer interface {
	Send(*HealthCheckResponse) error
	grpc.ServerStream
}

type UnimplementedHealthServer

type UnimplementedHealthServer struct {
}

UnimplementedHealthServer can be embedded to have forward compatible implementations.

func (*UnimplementedHealthServer) Check

func (*UnimplementedHealthServer) Watch

Jump to

Keyboard shortcuts

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