v1

package
v0.0.0-...-7a118a9 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_api_v1_version_proto protoreflect.FileDescriptor
View Source
var VersionService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "v1.VersionService",
	HandlerType: (*VersionServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Get",
			Handler:    _VersionService_Get_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/v1/version.proto",
}

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

Functions

func RegisterVersionServiceHandler

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

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

func RegisterVersionServiceHandlerClient

func RegisterVersionServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client VersionServiceClient) error

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

func RegisterVersionServiceHandlerFromEndpoint

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

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

func RegisterVersionServiceHandlerServer

func RegisterVersionServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server VersionServiceServer) error

RegisterVersionServiceHandlerServer registers the http handlers for service VersionService to "mux". UnaryRPC :call VersionServiceServer 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 RegisterVersionServiceHandlerFromEndpoint instead.

func RegisterVersionServiceServer

func RegisterVersionServiceServer(s grpc.ServiceRegistrar, srv VersionServiceServer)

Types

type UnimplementedVersionServiceServer

type UnimplementedVersionServiceServer struct {
}

UnimplementedVersionServiceServer should be embedded to have forward compatible implementations.

func (UnimplementedVersionServiceServer) Get

type UnsafeVersionServiceServer

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

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

type Version

type Version struct {
	Version   string                 `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
	Branch    string                 `protobuf:"bytes,2,opt,name=branch,proto3" json:"branch,omitempty"`
	Commit    string                 `protobuf:"bytes,3,opt,name=commit,proto3" json:"commit,omitempty"`
	GoVersion string                 `protobuf:"bytes,4,opt,name=go_version,json=goVersion,proto3" json:"go_version,omitempty"`
	Platform  string                 `protobuf:"bytes,5,opt,name=platform,proto3" json:"platform,omitempty"`
	BuildTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=build_time,json=buildTime,proto3" json:"build_time,omitempty"`
	// contains filtered or unexported fields
}

func (*Version) Descriptor deprecated

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

Deprecated: Use Version.ProtoReflect.Descriptor instead.

func (*Version) GetBranch

func (x *Version) GetBranch() string

func (*Version) GetBuildTime

func (x *Version) GetBuildTime() *timestamppb.Timestamp

func (*Version) GetCommit

func (x *Version) GetCommit() string

func (*Version) GetGoVersion

func (x *Version) GetGoVersion() string

func (*Version) GetPlatform

func (x *Version) GetPlatform() string

func (*Version) GetVersion

func (x *Version) GetVersion() string

func (*Version) ProtoMessage

func (*Version) ProtoMessage()

func (*Version) ProtoReflect

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

func (*Version) Reset

func (x *Version) Reset()

func (*Version) String

func (x *Version) String() string

type VersionServiceClient

type VersionServiceClient interface {
	Get(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Version, error)
}

VersionServiceClient is the client API for VersionService 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.

type VersionServiceServer

type VersionServiceServer interface {
	Get(context.Context, *emptypb.Empty) (*Version, error)
}

VersionServiceServer is the server API for VersionService service. All implementations should embed UnimplementedVersionServiceServer for forward compatibility

Jump to

Keyboard shortcuts

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