version

package
v4.25.2 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 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

View Source
const (
	Version_Version_FullMethodName = "/version.Version/Version"
)

Variables

View Source
var File_version_version_proto protoreflect.FileDescriptor
View Source
var Version_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "version.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 Request

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

func (*Request) Descriptor deprecated

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

Deprecated: Use Request.ProtoReflect.Descriptor instead.

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) ProtoReflect

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

func (*Request) Reset

func (x *Request) Reset()

func (*Request) String

func (x *Request) String() string

func (*Request) Validate

func (m *Request) Validate() error

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

func (m *Request) ValidateAll() error

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

type RequestMultiError

type RequestMultiError []error

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

func (RequestMultiError) AllErrors

func (m RequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (RequestMultiError) Error

func (m RequestMultiError) Error() string

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

type RequestValidationError

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

RequestValidationError is the validation error returned by Request.Validate if the designated constraints aren't met.

func (RequestValidationError) Cause

func (e RequestValidationError) Cause() error

Cause function returns cause value.

func (RequestValidationError) Error

func (e RequestValidationError) Error() string

Error satisfies the builtin error interface

func (RequestValidationError) ErrorName

func (e RequestValidationError) ErrorName() string

ErrorName returns error name.

func (RequestValidationError) Field

func (e RequestValidationError) Field() string

Field function returns field value.

func (RequestValidationError) Key

func (e RequestValidationError) Key() bool

Key function returns key value.

func (RequestValidationError) Reason

func (e RequestValidationError) Reason() string

Reason function returns reason value.

type Response

type Response struct {
	Version        string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
	BuildDate      string `protobuf:"bytes,2,opt,name=build_date,json=buildDate,proto3" json:"build_date,omitempty"`
	GitBranch      string `protobuf:"bytes,3,opt,name=git_branch,json=gitBranch,proto3" json:"git_branch,omitempty"`
	GitCommit      string `protobuf:"bytes,4,opt,name=git_commit,json=gitCommit,proto3" json:"git_commit,omitempty"`
	GitTag         string `protobuf:"bytes,5,opt,name=git_tag,json=gitTag,proto3" json:"git_tag,omitempty"`
	GoVersion      string `protobuf:"bytes,6,opt,name=go_version,json=goVersion,proto3" json:"go_version,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=kubectl_version,json=kubectlVersion,proto3" json:"kubectl_version,omitempty"`
	HelmVersion    string `protobuf:"bytes,10,opt,name=helm_version,json=helmVersion,proto3" json:"helm_version,omitempty"`
	GitRepo        string `protobuf:"bytes,11,opt,name=git_repo,json=gitRepo,proto3" json:"git_repo,omitempty"`
	// contains filtered or unexported fields
}

func (*Response) Descriptor deprecated

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

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetBuildDate

func (x *Response) GetBuildDate() string

func (*Response) GetCompiler

func (x *Response) GetCompiler() string

func (*Response) GetGitBranch

func (x *Response) GetGitBranch() string

func (*Response) GetGitCommit

func (x *Response) GetGitCommit() string

func (*Response) GetGitRepo

func (x *Response) GetGitRepo() string

func (*Response) GetGitTag

func (x *Response) GetGitTag() string

func (*Response) GetGoVersion

func (x *Response) GetGoVersion() string

func (*Response) GetHelmVersion

func (x *Response) GetHelmVersion() string

func (*Response) GetKubectlVersion

func (x *Response) GetKubectlVersion() string

func (*Response) GetPlatform

func (x *Response) GetPlatform() string

func (*Response) GetVersion

func (x *Response) GetVersion() string

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect

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

func (*Response) Reset

func (x *Response) Reset()

func (*Response) String

func (x *Response) String() string

func (*Response) Validate

func (m *Response) Validate() error

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

func (m *Response) ValidateAll() error

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

type ResponseMultiError

type ResponseMultiError []error

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

func (ResponseMultiError) AllErrors

func (m ResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ResponseMultiError) Error

func (m ResponseMultiError) Error() string

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

type ResponseValidationError

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

ResponseValidationError is the validation error returned by Response.Validate if the designated constraints aren't met.

func (ResponseValidationError) Cause

func (e ResponseValidationError) Cause() error

Cause function returns cause value.

func (ResponseValidationError) Error

func (e ResponseValidationError) Error() string

Error satisfies the builtin error interface

func (ResponseValidationError) ErrorName

func (e ResponseValidationError) ErrorName() string

ErrorName returns error name.

func (ResponseValidationError) Field

func (e ResponseValidationError) Field() string

Field function returns field value.

func (ResponseValidationError) Key

func (e ResponseValidationError) Key() bool

Key function returns key value.

func (ResponseValidationError) Reason

func (e ResponseValidationError) Reason() string

Reason function returns reason value.

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 *Request, opts ...grpc.CallOption) (*Response, 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 VersionServer

type VersionServer interface {
	// Version 获取当前版本信息
	Version(context.Context, *Request) (*Response, 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