public

package
v0.0.0-...-9615664 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2023 License: GPL-3.0 Imports: 29 Imported by: 0

Documentation

Overview

Package public is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	Public_GetInstance_FullMethodName = "/apis.proto.v1alpha1.public.Public/GetInstance"
)

Variables

View Source
var File_proto_v1alpha1_public_public_proto protoreflect.FileDescriptor
View Source
var Public_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "apis.proto.v1alpha1.public.Public",
	HandlerType: (*PublicServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetInstance",
			Handler:    _Public_GetInstance_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "proto/v1alpha1/public/public.proto",
}

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

Functions

func RegisterPublicHandler

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

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

func RegisterPublicHandlerClient

func RegisterPublicHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PublicClient) error

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

func RegisterPublicHandlerFromEndpoint

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

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

func RegisterPublicHandlerServer

func RegisterPublicHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PublicServer) error

RegisterPublicHandlerServer registers the http handlers for service Public to "mux". UnaryRPC :call PublicServer 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 RegisterPublicHandlerFromEndpoint instead.

func RegisterPublicServer

func RegisterPublicServer(s grpc.ServiceRegistrar, srv PublicServer)

Types

type GetInstanceResponse

type GetInstanceResponse struct {
	Code    string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"`
	Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
	// contains filtered or unexported fields
}

func (*GetInstanceResponse) Descriptor deprecated

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

Deprecated: Use GetInstanceResponse.ProtoReflect.Descriptor instead.

func (*GetInstanceResponse) GetCode

func (x *GetInstanceResponse) GetCode() string

func (*GetInstanceResponse) GetVersion

func (x *GetInstanceResponse) GetVersion() string

func (*GetInstanceResponse) ProtoMessage

func (*GetInstanceResponse) ProtoMessage()

func (*GetInstanceResponse) ProtoReflect

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

func (*GetInstanceResponse) Reset

func (x *GetInstanceResponse) Reset()

func (*GetInstanceResponse) String

func (x *GetInstanceResponse) String() string

func (*GetInstanceResponse) Validate

func (m *GetInstanceResponse) Validate() error

Validate checks the field values on GetInstanceResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*GetInstanceResponse) ValidateAll

func (m *GetInstanceResponse) ValidateAll() error

ValidateAll checks the field values on GetInstanceResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in GetInstanceResponseMultiError, or nil if none found.

type GetInstanceResponseMultiError

type GetInstanceResponseMultiError []error

GetInstanceResponseMultiError is an error wrapping multiple validation errors returned by GetInstanceResponse.ValidateAll() if the designated constraints aren't met.

func (GetInstanceResponseMultiError) AllErrors

func (m GetInstanceResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GetInstanceResponseMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type GetInstanceResponseValidationError

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

GetInstanceResponseValidationError is the validation error returned by GetInstanceResponse.Validate if the designated constraints aren't met.

func (GetInstanceResponseValidationError) Cause

Cause function returns cause value.

func (GetInstanceResponseValidationError) Error

Error satisfies the builtin error interface

func (GetInstanceResponseValidationError) ErrorName

ErrorName returns error name.

func (GetInstanceResponseValidationError) Field

Field function returns field value.

func (GetInstanceResponseValidationError) Key

Key function returns key value.

func (GetInstanceResponseValidationError) Reason

Reason function returns reason value.

type PublicClient

type PublicClient interface {
	GetInstance(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetInstanceResponse, error)
}

PublicClient is the client API for Public 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 NewPublicClient

func NewPublicClient(cc grpc.ClientConnInterface) PublicClient

type PublicServer

type PublicServer interface {
	GetInstance(context.Context, *emptypb.Empty) (*GetInstanceResponse, error)
}

PublicServer is the server API for Public service. All implementations should embed UnimplementedPublicServer for forward compatibility

type UnimplementedPublicServer

type UnimplementedPublicServer struct {
}

UnimplementedPublicServer should be embedded to have forward compatible implementations.

func (UnimplementedPublicServer) GetInstance

type UnsafePublicServer

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

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

Jump to

Keyboard shortcuts

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