api_v1pb

package
v1.51.1 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package api_v1pb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_goadesign_goagen_health_proto protoreflect.FileDescriptor
View Source
var Health_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "api.v1.Health",
	HandlerType: (*HealthServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetStatus",
			Handler:    _Health_GetStatus_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "goadesign_goagen_health.proto",
}

Health_ServiceDesc is the grpc.ServiceDesc for Health service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

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. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterHealthHandlerFromEndpoint instead.

func RegisterHealthServer

func RegisterHealthServer(s grpc.ServiceRegistrar, srv HealthServer)

Types

type GetStatusRequest

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

func (*GetStatusRequest) Descriptor deprecated

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

Deprecated: Use GetStatusRequest.ProtoReflect.Descriptor instead.

func (*GetStatusRequest) ProtoMessage

func (*GetStatusRequest) ProtoMessage()

func (*GetStatusRequest) ProtoReflect

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

func (*GetStatusRequest) Reset

func (x *GetStatusRequest) Reset()

func (*GetStatusRequest) String

func (x *GetStatusRequest) String() string

type GetStatusResponse

type GetStatusResponse struct {

	// Status of the response.
	S string `protobuf:"bytes,1,opt,name=s,proto3" json:"s,omitempty"`
	// Error message.
	Errmsg string        `protobuf:"bytes,2,opt,name=errmsg,proto3" json:"errmsg,omitempty"`
	Data   *HealthStatus `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
	Status string        `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*GetStatusResponse) Descriptor deprecated

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

Deprecated: Use GetStatusResponse.ProtoReflect.Descriptor instead.

func (*GetStatusResponse) GetData

func (x *GetStatusResponse) GetData() *HealthStatus

func (*GetStatusResponse) GetErrmsg

func (x *GetStatusResponse) GetErrmsg() string

func (*GetStatusResponse) GetS

func (x *GetStatusResponse) GetS() string

func (*GetStatusResponse) GetStatus

func (x *GetStatusResponse) GetStatus() string

func (*GetStatusResponse) ProtoMessage

func (*GetStatusResponse) ProtoMessage()

func (*GetStatusResponse) ProtoReflect

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

func (*GetStatusResponse) Reset

func (x *GetStatusResponse) Reset()

func (*GetStatusResponse) String

func (x *GetStatusResponse) String() string

type HealthClient

type HealthClient interface {
	// Get current backend health status
	GetStatus(ctx context.Context, in *GetStatusRequest, opts ...grpc.CallOption) (*GetStatusResponse, error)
}

HealthClient is the client API for Health service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewHealthClient

func NewHealthClient(cc grpc.ClientConnInterface) HealthClient

type HealthServer

type HealthServer interface {
	// Get current backend health status
	GetStatus(context.Context, *GetStatusRequest) (*GetStatusResponse, error)
	// contains filtered or unexported methods
}

HealthServer is the server API for Health service. All implementations must embed UnimplementedHealthServer for forward compatibility

type HealthStatus

type HealthStatus struct {

	// Block height from local mongo exchange db.
	LocalHeight int32 `protobuf:"zigzag32,1,opt,name=local_height,json=localHeight,proto3" json:"local_height,omitempty"`
	// block timestamp from local mongo exchange db.
	LocalTimestamp int32 `protobuf:"zigzag32,2,opt,name=local_timestamp,json=localTimestamp,proto3" json:"local_timestamp,omitempty"`
	// block height from Horacle service.
	HoracleHeight int32 `protobuf:"zigzag32,3,opt,name=horacle_height,json=horacleHeight,proto3" json:"horacle_height,omitempty"`
	// block timestamp from Horacle service.
	HoracleTimestamp int32 `protobuf:"zigzag32,4,opt,name=horacle_timestamp,json=horacleTimestamp,proto3" json:"horacle_timestamp,omitempty"`
	// contains filtered or unexported fields
}

Status defines the structure for health information

func (*HealthStatus) Descriptor deprecated

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

Deprecated: Use HealthStatus.ProtoReflect.Descriptor instead.

func (*HealthStatus) GetHoracleHeight

func (x *HealthStatus) GetHoracleHeight() int32

func (*HealthStatus) GetHoracleTimestamp

func (x *HealthStatus) GetHoracleTimestamp() int32

func (*HealthStatus) GetLocalHeight

func (x *HealthStatus) GetLocalHeight() int32

func (*HealthStatus) GetLocalTimestamp

func (x *HealthStatus) GetLocalTimestamp() int32

func (*HealthStatus) ProtoMessage

func (*HealthStatus) ProtoMessage()

func (*HealthStatus) ProtoReflect

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

func (*HealthStatus) Reset

func (x *HealthStatus) Reset()

func (*HealthStatus) String

func (x *HealthStatus) String() string

type UnimplementedHealthServer

type UnimplementedHealthServer struct {
}

UnimplementedHealthServer must be embedded to have forward compatible implementations.

func (UnimplementedHealthServer) GetStatus

type UnsafeHealthServer

type UnsafeHealthServer interface {
	// contains filtered or unexported methods
}

UnsafeHealthServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to HealthServer will result in compilation errors.

Jump to

Keyboard shortcuts

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