Documentation ¶
Index ¶
- Constants
- Variables
- func IsCompatible(rawClient, rawServer *Version) error
- func RegisterAPIServer(s grpc.ServiceRegistrar, srv APIServer)
- type APIClient
- type APIServer
- type UnimplementedAPIServer
- type UnsafeAPIServer
- type Version
- func (v *Version) Canonical() string
- func (*Version) Descriptor() ([]byte, []int)deprecated
- func (x *Version) GetAdditional() string
- func (x *Version) GetBuildDate() string
- func (x *Version) GetGitCommit() string
- func (x *Version) GetGitTreeModified() string
- func (x *Version) GetGoVersion() string
- func (x *Version) GetMajor() uint32
- func (x *Version) GetMicro() uint32
- func (x *Version) GetMinor() uint32
- func (x *Version) GetPlatform() string
- func (v *Version) IsDevelopment() bool
- func (x *Version) MarshalLogObject(enc zapcore.ObjectEncoder) error
- func (*Version) ProtoMessage()
- func (x *Version) ProtoReflect() protoreflect.Message
- func (x *Version) Reset()
- func (x *Version) String() string
Constants ¶
const (
API_GetVersion_FullMethodName = "/versionpb_v2.API/GetVersion"
)
Variables ¶
var ( ErrClientIsNil = errors.New("client version is missing") ErrServerIsNil = errors.New("server version is nil") ErrClientTooOld = errors.New("client is outdated") ErrServerTooOld = errors.New("server is outdated") ErrIncompatiblePreview = errors.New("client and server versions must match exactly") )
var API_ServiceDesc = grpc.ServiceDesc{ ServiceName: "versionpb_v2.API", HandlerType: (*APIServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetVersion", Handler: _API_GetVersion_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "version/versionpb/version.proto", }
API_ServiceDesc is the grpc.ServiceDesc for API service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_version_versionpb_version_proto protoreflect.FileDescriptor
Functions ¶
func IsCompatible ¶
IsCompatible determines if two versions are compatible. Versions are compatible if the versions are identical or one version is a development build, or if either the server or client are not prereleases, then the major and minor numbers are identical.
func RegisterAPIServer ¶
func RegisterAPIServer(s grpc.ServiceRegistrar, srv APIServer)
Types ¶
type APIClient ¶
type APIClient interface {
GetVersion(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Version, error)
}
APIClient is the client API for API 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 NewAPIClient ¶
func NewAPIClient(cc grpc.ClientConnInterface) APIClient
type APIServer ¶
type APIServer interface { GetVersion(context.Context, *emptypb.Empty) (*Version, error) // contains filtered or unexported methods }
APIServer is the server API for API service. All implementations must embed UnimplementedAPIServer for forward compatibility
type UnimplementedAPIServer ¶
type UnimplementedAPIServer struct { }
UnimplementedAPIServer must be embedded to have forward compatible implementations.
func (UnimplementedAPIServer) GetVersion ¶
type UnsafeAPIServer ¶ added in v2.7.0
type UnsafeAPIServer interface {
// contains filtered or unexported methods
}
UnsafeAPIServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to APIServer will result in compilation errors.
type Version ¶
type Version struct { Major uint32 `protobuf:"varint,1,opt,name=major,proto3" json:"major,omitempty"` Minor uint32 `protobuf:"varint,2,opt,name=minor,proto3" json:"minor,omitempty"` Micro uint32 `protobuf:"varint,3,opt,name=micro,proto3" json:"micro,omitempty"` Additional string `protobuf:"bytes,4,opt,name=additional,proto3" json:"additional,omitempty"` GitCommit string `protobuf:"bytes,5,opt,name=git_commit,json=gitCommit,proto3" json:"git_commit,omitempty"` GitTreeModified string `protobuf:"bytes,6,opt,name=git_tree_modified,json=gitTreeModified,proto3" json:"git_tree_modified,omitempty"` BuildDate string `protobuf:"bytes,7,opt,name=build_date,json=buildDate,proto3" json:"build_date,omitempty"` GoVersion string `protobuf:"bytes,8,opt,name=go_version,json=goVersion,proto3" json:"go_version,omitempty"` Platform string `protobuf:"bytes,9,opt,name=platform,proto3" json:"platform,omitempty"` // contains filtered or unexported fields }
func (*Version) Canonical ¶
Canonical returns the version in canonical semver form, according to golang.org/x/mod/semver.
func (*Version) Descriptor
deprecated
func (*Version) GetAdditional ¶
func (*Version) GetBuildDate ¶
func (*Version) GetGitCommit ¶
func (*Version) GetGitTreeModified ¶
func (*Version) GetGoVersion ¶
func (*Version) GetPlatform ¶
func (*Version) IsDevelopment ¶
IsDevelopment returns true if the version is from a local unreleased build.
func (*Version) MarshalLogObject ¶
func (x *Version) MarshalLogObject(enc zapcore.ObjectEncoder) error
func (*Version) ProtoMessage ¶
func (*Version) ProtoMessage()
func (*Version) ProtoReflect ¶ added in v2.7.0
func (x *Version) ProtoReflect() protoreflect.Message