rpc

package
v0.5.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Status_name = map[int32]string{
		0: "STATUS_UNSPECIFIED",
		1: "STATUS_OK",
		2: "STATUS_DEGRADED",
		3: "STATUS_ERROR",
	}
	Status_value = map[string]int32{
		"STATUS_UNSPECIFIED": 0,
		"STATUS_OK":          1,
		"STATUS_DEGRADED":    2,
		"STATUS_ERROR":       3,
	}
)

Enum value maps for Status.

View Source
var File_health_rpc_rpc_proto protoreflect.FileDescriptor

Functions

func RegisterRPCServiceServer

func RegisterRPCServiceServer(s *grpc.Server, srv RPCServiceServer)

Types

type CheckRequest

type CheckRequest struct {
	// contains filtered or unexported fields
}

func (*CheckRequest) Descriptor deprecated

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

Deprecated: Use CheckRequest.ProtoReflect.Descriptor instead.

func (*CheckRequest) ProtoMessage

func (*CheckRequest) ProtoMessage()

func (*CheckRequest) ProtoReflect

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

func (*CheckRequest) Reset

func (x *CheckRequest) Reset()

func (*CheckRequest) String

func (x *CheckRequest) String() string

type CheckResponse

type CheckResponse struct {
	Status   Status   `protobuf:"varint,1,opt,name=status,proto3,enum=health.rpc.Status" json:"status,omitempty"`
	Messages []string `protobuf:"bytes,2,rep,name=messages,proto3" json:"messages,omitempty"`
	// contains filtered or unexported fields
}

func (*CheckResponse) Descriptor deprecated

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

Deprecated: Use CheckResponse.ProtoReflect.Descriptor instead.

func (*CheckResponse) GetMessages

func (x *CheckResponse) GetMessages() []string

func (*CheckResponse) GetStatus

func (x *CheckResponse) GetStatus() Status

func (*CheckResponse) ProtoMessage

func (*CheckResponse) ProtoMessage()

func (*CheckResponse) ProtoReflect

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

func (*CheckResponse) Reset

func (x *CheckResponse) Reset()

func (*CheckResponse) String

func (x *CheckResponse) String() string

type RPC

type RPC struct {
	UnimplementedRPCServiceServer
	// contains filtered or unexported fields
}

RPC implements the rpc service.

func New

func New(m *health.Module) *RPC

New creates a new rpc service.

func (*RPC) Check

func (a *RPC) Check(ctx context.Context, req *CheckRequest) (*CheckResponse, error)

Check calls module.Check.

type RPCServiceClient

type RPCServiceClient interface {
	Check(ctx context.Context, in *CheckRequest, opts ...grpc.CallOption) (*CheckResponse, error)
}

RPCServiceClient is the client API for RPCService service.

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

func NewRPCServiceClient

func NewRPCServiceClient(cc grpc.ClientConnInterface) RPCServiceClient

type RPCServiceServer

type RPCServiceServer interface {
	Check(context.Context, *CheckRequest) (*CheckResponse, error)
}

RPCServiceServer is the server API for RPCService service.

type Status

type Status int32
const (
	Status_STATUS_UNSPECIFIED Status = 0
	Status_STATUS_OK          Status = 1
	Status_STATUS_DEGRADED    Status = 2
	Status_STATUS_ERROR       Status = 3
)

func (Status) Descriptor

func (Status) Descriptor() protoreflect.EnumDescriptor

func (Status) Enum

func (x Status) Enum() *Status

func (Status) EnumDescriptor deprecated

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

Deprecated: Use Status.Descriptor instead.

func (Status) Number

func (x Status) Number() protoreflect.EnumNumber

func (Status) String

func (x Status) String() string

func (Status) Type

func (Status) Type() protoreflect.EnumType

type UnimplementedRPCServiceServer

type UnimplementedRPCServiceServer struct {
}

UnimplementedRPCServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedRPCServiceServer) Check

Jump to

Keyboard shortcuts

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