Documentation ¶
Overview ¶
Package version is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterVersionHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterVersionHandlerClient(ctx context.Context, mux *runtime.ServeMux, client VersionClient) error
- func RegisterVersionHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterVersionHandlerServer(ctx context.Context, mux *runtime.ServeMux, server VersionServer) error
- func RegisterVersionServer(s grpc.ServiceRegistrar, srv VersionServer)
- type Request
- type RequestMultiError
- type RequestValidationError
- type Response
- func (*Response) Descriptor() ([]byte, []int)deprecated
- func (x *Response) GetBuildDate() string
- func (x *Response) GetCompiler() string
- func (x *Response) GetGitBranch() string
- func (x *Response) GetGitCommit() string
- func (x *Response) GetGitRepo() string
- func (x *Response) GetGitTag() string
- func (x *Response) GetGoVersion() string
- func (x *Response) GetHelmVersion() string
- func (x *Response) GetKubectlVersion() string
- func (x *Response) GetPlatform() string
- func (x *Response) GetVersion() string
- func (*Response) ProtoMessage()
- func (x *Response) ProtoReflect() protoreflect.Message
- func (x *Response) Reset()
- func (x *Response) String() string
- func (m *Response) Validate() error
- func (m *Response) ValidateAll() error
- type ResponseMultiError
- type ResponseValidationError
- type UnimplementedVersionServer
- type UnsafeVersionServer
- type VersionClient
- type VersionServer
Constants ¶
const (
Version_Version_FullMethodName = "/version.Version/Version"
)
Variables ¶
var File_version_version_proto protoreflect.FileDescriptor
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) ProtoMessage ¶
func (*Request) ProtoMessage()
func (*Request) ProtoReflect ¶
func (x *Request) ProtoReflect() protoreflect.Message
func (*Request) Validate ¶
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 ¶
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) GetBuildDate ¶
func (*Response) GetCompiler ¶
func (*Response) GetGitBranch ¶
func (*Response) GetGitCommit ¶
func (*Response) GetGitRepo ¶
func (*Response) GetGoVersion ¶
func (*Response) GetHelmVersion ¶
func (*Response) GetKubectlVersion ¶
func (*Response) GetPlatform ¶
func (*Response) GetVersion ¶
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) ProtoReflect ¶
func (x *Response) ProtoReflect() protoreflect.Message
func (*Response) Validate ¶
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 ¶
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.
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