version

package
v0.0.0-...-51115e0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2022 License: AGPL-3.0 Imports: 29 Imported by: 0

Documentation

Overview

Package version is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_version_version_proto protoreflect.FileDescriptor
View Source
var Version_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "Version",
	HandlerType: (*VersionServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Version",
			Handler:    _Version_Version_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "version/version.proto",
}

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

Functions

func RegisterVersionHandler

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

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

func RegisterVersionHandlerClient

func RegisterVersionHandlerClient(ctx context.Context, mux *runtime.ServeMux, client VersionClient) error

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

func RegisterVersionHandlerFromEndpoint

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

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

func RegisterVersionHandlerServer

func RegisterVersionHandlerServer(ctx context.Context, mux *runtime.ServeMux, server VersionServer) error

RegisterVersionHandlerServer registers the http handlers for service Version to "mux". UnaryRPC :call VersionServer 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 RegisterVersionHandlerFromEndpoint instead.

func RegisterVersionServer

func RegisterVersionServer(s grpc.ServiceRegistrar, srv VersionServer)

Types

type UnimplementedVersionServer

type UnimplementedVersionServer struct {
}

UnimplementedVersionServer must be embedded to have forward compatible implementations.

func (UnimplementedVersionServer) Version

type UnsafeVersionServer

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

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

type VersionClient

type VersionClient interface {
	// Version 获取当前版本信息
	Version(ctx context.Context, in *VersionRequest, opts ...grpc.CallOption) (*VersionResponse, error)
}

VersionClient is the client API for Version 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 NewVersionClient

func NewVersionClient(cc grpc.ClientConnInterface) VersionClient

type VersionRequest

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

func (*VersionRequest) Descriptor deprecated

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

Deprecated: Use VersionRequest.ProtoReflect.Descriptor instead.

func (*VersionRequest) ProtoMessage

func (*VersionRequest) ProtoMessage()

func (*VersionRequest) ProtoReflect

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

func (*VersionRequest) Reset

func (x *VersionRequest) Reset()

func (*VersionRequest) String

func (x *VersionRequest) String() string

func (*VersionRequest) Validate

func (m *VersionRequest) Validate() error

Validate checks the field values on VersionRequest 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 (*VersionRequest) ValidateAll

func (m *VersionRequest) ValidateAll() error

ValidateAll checks the field values on VersionRequest 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 VersionRequestMultiError, or nil if none found.

type VersionRequestMultiError

type VersionRequestMultiError []error

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

func (VersionRequestMultiError) AllErrors

func (m VersionRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (VersionRequestMultiError) Error

func (m VersionRequestMultiError) Error() string

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

type VersionRequestValidationError

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

VersionRequestValidationError is the validation error returned by VersionRequest.Validate if the designated constraints aren't met.

func (VersionRequestValidationError) Cause

Cause function returns cause value.

func (VersionRequestValidationError) Error

Error satisfies the builtin error interface

func (VersionRequestValidationError) ErrorName

func (e VersionRequestValidationError) ErrorName() string

ErrorName returns error name.

func (VersionRequestValidationError) Field

Field function returns field value.

func (VersionRequestValidationError) Key

Key function returns key value.

func (VersionRequestValidationError) Reason

Reason function returns reason value.

type VersionResponse

type VersionResponse struct {
	Version        string `protobuf:"bytes,1,opt,name=Version,proto3" json:"Version,omitempty"`
	BuildDate      string `protobuf:"bytes,2,opt,name=BuildDate,proto3" json:"BuildDate,omitempty"`
	GitBranch      string `protobuf:"bytes,3,opt,name=gitBranch,proto3" json:"gitBranch,omitempty"`
	GitCommit      string `protobuf:"bytes,4,opt,name=GitCommit,proto3" json:"GitCommit,omitempty"`
	GitTag         string `protobuf:"bytes,5,opt,name=GitTag,proto3" json:"GitTag,omitempty"`
	GoVersion      string `protobuf:"bytes,6,opt,name=GoVersion,proto3" json:"GoVersion,omitempty"`
	Compiler       string `protobuf:"bytes,7,opt,name=Compiler,proto3" json:"Compiler,omitempty"`
	Platform       string `protobuf:"bytes,8,opt,name=Platform,proto3" json:"Platform,omitempty"`
	KubectlVersion string `protobuf:"bytes,9,opt,name=KubectlVersion,proto3" json:"KubectlVersion,omitempty"`
	HelmVersion    string `protobuf:"bytes,10,opt,name=HelmVersion,proto3" json:"HelmVersion,omitempty"`
	GitRepo        string `protobuf:"bytes,11,opt,name=GitRepo,proto3" json:"GitRepo,omitempty"`
	// contains filtered or unexported fields
}

func (*VersionResponse) Descriptor deprecated

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

Deprecated: Use VersionResponse.ProtoReflect.Descriptor instead.

func (*VersionResponse) GetBuildDate

func (x *VersionResponse) GetBuildDate() string

func (*VersionResponse) GetCompiler

func (x *VersionResponse) GetCompiler() string

func (*VersionResponse) GetGitBranch

func (x *VersionResponse) GetGitBranch() string

func (*VersionResponse) GetGitCommit

func (x *VersionResponse) GetGitCommit() string

func (*VersionResponse) GetGitRepo

func (x *VersionResponse) GetGitRepo() string

func (*VersionResponse) GetGitTag

func (x *VersionResponse) GetGitTag() string

func (*VersionResponse) GetGoVersion

func (x *VersionResponse) GetGoVersion() string

func (*VersionResponse) GetHelmVersion

func (x *VersionResponse) GetHelmVersion() string

func (*VersionResponse) GetKubectlVersion

func (x *VersionResponse) GetKubectlVersion() string

func (*VersionResponse) GetPlatform

func (x *VersionResponse) GetPlatform() string

func (*VersionResponse) GetVersion

func (x *VersionResponse) GetVersion() string

func (*VersionResponse) ProtoMessage

func (*VersionResponse) ProtoMessage()

func (*VersionResponse) ProtoReflect

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

func (*VersionResponse) Reset

func (x *VersionResponse) Reset()

func (*VersionResponse) String

func (x *VersionResponse) String() string

func (*VersionResponse) Validate

func (m *VersionResponse) Validate() error

Validate checks the field values on VersionResponse 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 (*VersionResponse) ValidateAll

func (m *VersionResponse) ValidateAll() error

ValidateAll checks the field values on VersionResponse 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 VersionResponseMultiError, or nil if none found.

type VersionResponseMultiError

type VersionResponseMultiError []error

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

func (VersionResponseMultiError) AllErrors

func (m VersionResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (VersionResponseMultiError) Error

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

type VersionResponseValidationError

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

VersionResponseValidationError is the validation error returned by VersionResponse.Validate if the designated constraints aren't met.

func (VersionResponseValidationError) Cause

Cause function returns cause value.

func (VersionResponseValidationError) Error

Error satisfies the builtin error interface

func (VersionResponseValidationError) ErrorName

func (e VersionResponseValidationError) ErrorName() string

ErrorName returns error name.

func (VersionResponseValidationError) Field

Field function returns field value.

func (VersionResponseValidationError) Key

Key function returns key value.

func (VersionResponseValidationError) Reason

Reason function returns reason value.

type VersionServer

type VersionServer interface {
	// Version 获取当前版本信息
	Version(context.Context, *VersionRequest) (*VersionResponse, error)
	// contains filtered or unexported methods
}

VersionServer is the server API for Version service. All implementations must embed UnimplementedVersionServer for forward compatibility

Jump to

Keyboard shortcuts

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