triple_health

package
v3.2.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Code generated by protoc-gen-triple. DO NOT EDIT.

Source: health.proto

Index

Constants

View Source
const (
	// HealthCheckProcedure is the fully-qualified name of the Health's Check RPC.
	HealthCheckProcedure = "/grpc.health.v1.Health/Check"
	// HealthWatchProcedure is the fully-qualified name of the Health's Watch RPC.
	HealthWatchProcedure = "/grpc.health.v1.Health/Watch"
)

These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as procedure and as the final two segments of the HTTP route.

Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.

View Source
const (
	// HealthName is the fully-qualified name of the Health service.
	HealthName = "grpc.health.v1.Health"
)

Variables

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

Enum value maps for HealthCheckResponse_ServingStatus.

View Source
var File_health_proto protoreflect.FileDescriptor
View Source
var Health_ClientInfo = client.ClientInfo{
	InterfaceName: "grpc.health.v1.Health",
	MethodNames:   []string{"Check", "Watch"},
	ConnectionInjectFunc: func(dubboCliRaw interface{}, conn *client.Connection) {
		dubboCli := dubboCliRaw.(*HealthImpl)
		dubboCli.conn = conn
	},
}
View Source
var Health_ServiceInfo = server.ServiceInfo{
	InterfaceName: "grpc.health.v1.Health",
	ServiceType:   (*HealthHandler)(nil),
	Methods: []server.MethodInfo{
		{
			Name: "Check",
			Type: constant.CallUnary,
			ReqInitFunc: func() interface{} {
				return new(HealthCheckRequest)
			},
			MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
				req := args[0].(*HealthCheckRequest)
				res, err := handler.(HealthHandler).Check(ctx, req)
				if err != nil {
					return nil, err
				}
				return triple_protocol.NewResponse(res), nil
			},
		},
		{
			Name: "Watch",
			Type: constant.CallServerStream,
			ReqInitFunc: func() interface{} {
				return new(HealthCheckRequest)
			},
			StreamInitFunc: func(baseStream interface{}) interface{} {
				return &HealthWatchServer{baseStream.(*triple_protocol.ServerStream)}
			},
			MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
				req := args[0].(*HealthCheckRequest)
				stream := args[1].(Health_WatchServer)
				if err := handler.(HealthHandler).Watch(ctx, req, stream); err != nil {
					return nil, err
				}
				return nil, nil
			},
		},
	},
}

Functions

func RegisterHealthHandler

func RegisterHealthHandler(srv *server.Server, hdlr HealthHandler, opts ...server.ServiceOption) error

func SetConsumerService

func SetConsumerService(srv common.RPCService)

func SetProviderService

func SetProviderService(srv common.RPCService)

Types

type Health

type Health interface {
	Check(ctx context.Context, req *HealthCheckRequest, opts ...client.CallOption) (*HealthCheckResponse, error)
	Watch(ctx context.Context, req *HealthCheckRequest, opts ...client.CallOption) (Health_WatchClient, error)
}

Health is a client for the grpc.health.v1.Health service.

func NewHealth

func NewHealth(cli *client.Client, opts ...client.ReferenceOption) (Health, error)

NewHealth constructs a client for the grpc.health.v1.Health service.

type HealthCheckRequest

type HealthCheckRequest struct {
	Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"`
	// contains filtered or unexported fields
}

func (*HealthCheckRequest) Descriptor deprecated

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

Deprecated: Use HealthCheckRequest.ProtoReflect.Descriptor instead.

func (*HealthCheckRequest) GetService

func (x *HealthCheckRequest) GetService() string

func (*HealthCheckRequest) ProtoMessage

func (*HealthCheckRequest) ProtoMessage()

func (*HealthCheckRequest) ProtoReflect

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

func (*HealthCheckRequest) Reset

func (x *HealthCheckRequest) Reset()

func (*HealthCheckRequest) String

func (x *HealthCheckRequest) String() string

type HealthCheckResponse

type HealthCheckResponse struct {
	Status HealthCheckResponse_ServingStatus `protobuf:"varint,1,opt,name=status,proto3,enum=dubbo.health.v1.HealthCheckResponse_ServingStatus" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*HealthCheckResponse) Descriptor deprecated

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

Deprecated: Use HealthCheckResponse.ProtoReflect.Descriptor instead.

func (*HealthCheckResponse) GetStatus

func (*HealthCheckResponse) ProtoMessage

func (*HealthCheckResponse) ProtoMessage()

func (*HealthCheckResponse) ProtoReflect

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

func (*HealthCheckResponse) Reset

func (x *HealthCheckResponse) Reset()

func (*HealthCheckResponse) String

func (x *HealthCheckResponse) String() string

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 // Used only by the Watch method.
)

func (HealthCheckResponse_ServingStatus) Descriptor

func (HealthCheckResponse_ServingStatus) Enum

func (HealthCheckResponse_ServingStatus) EnumDescriptor deprecated

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

Deprecated: Use HealthCheckResponse_ServingStatus.Descriptor instead.

func (HealthCheckResponse_ServingStatus) Number

func (HealthCheckResponse_ServingStatus) String

func (HealthCheckResponse_ServingStatus) Type

type HealthHandler

HealthHandler is an implementation of the grpc.health.v1.Health service.

type HealthImpl

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

HealthImpl implements Health.

func (*HealthImpl) Check

func (*HealthImpl) Watch

type HealthWatchClient

type HealthWatchClient struct {
	*triple_protocol.ServerStreamForClient
}

func (*HealthWatchClient) Conn

func (*HealthWatchClient) Msg

func (*HealthWatchClient) Recv

func (cli *HealthWatchClient) Recv() bool

type HealthWatchServer

type HealthWatchServer struct {
	*triple_protocol.ServerStream
}

func (*HealthWatchServer) Send

type Health_WatchClient

type Health_WatchClient interface {
	Recv() bool
	ResponseHeader() http.Header
	ResponseTrailer() http.Header
	Msg() *HealthCheckResponse
	Err() error
	Conn() (triple_protocol.StreamingClientConn, error)
	Close() error
}

type Health_WatchServer

type Health_WatchServer interface {
	Send(*HealthCheckResponse) error
	ResponseHeader() http.Header
	ResponseTrailer() http.Header
	Conn() triple_protocol.StreamingHandlerConn
}

Jump to

Keyboard shortcuts

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