versionpb

package
v2.7.0-nightly.20230529 Latest Latest
Warning

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

Go to latest
Published: May 26, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClientTooOld        = errors.New("client is outdated")
	ErrServerTooOld        = errors.New("server is outdated")
	ErrIncompatiblePreview = errors.New("client and server versions must match exactly")
)
View Source
var (
	ErrInvalidLengthVersion        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowVersion          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupVersion = fmt.Errorf("proto: unexpected end of group")
)

Functions

func IsCompatible

func IsCompatible(rawClient, rawServer *Version) error

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.Server, srv APIServer)

Types

type APIClient

type APIClient interface {
	GetVersion(ctx context.Context, in *types.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://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewAPIClient

func NewAPIClient(cc *grpc.ClientConn) APIClient

type APIServer

type APIServer interface {
	GetVersion(context.Context, *types.Empty) (*Version, error)
}

APIServer is the server API for API service.

type UnimplementedAPIServer

type UnimplementedAPIServer struct {
}

UnimplementedAPIServer can be embedded to have forward compatible implementations.

func (*UnimplementedAPIServer) GetVersion

func (*UnimplementedAPIServer) GetVersion(ctx context.Context, req *types.Empty) (*Version, error)

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Version) Canonical

func (v *Version) Canonical() string

Canonical returns the version in canonical semver form, according to golang.org/x/mod/semver.

func (*Version) Descriptor

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

func (*Version) GetAdditional

func (m *Version) GetAdditional() string

func (*Version) GetBuildDate

func (m *Version) GetBuildDate() string

func (*Version) GetGitCommit

func (m *Version) GetGitCommit() string

func (*Version) GetGitTreeModified

func (m *Version) GetGitTreeModified() string

func (*Version) GetGoVersion

func (m *Version) GetGoVersion() string

func (*Version) GetMajor

func (m *Version) GetMajor() uint32

func (*Version) GetMicro

func (m *Version) GetMicro() uint32

func (*Version) GetMinor

func (m *Version) GetMinor() uint32

func (*Version) GetPlatform

func (m *Version) GetPlatform() string

func (*Version) IsDevelopment

func (v *Version) IsDevelopment() bool

IsDevelopment returns true if the version is from a local unreleased build.

func (*Version) Marshal

func (m *Version) Marshal() (dAtA []byte, err error)

func (*Version) MarshalLogObject

func (x *Version) MarshalLogObject(enc zapcore.ObjectEncoder) error

func (*Version) MarshalTo

func (m *Version) MarshalTo(dAtA []byte) (int, error)

func (*Version) MarshalToSizedBuffer

func (m *Version) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Version) ProtoMessage

func (*Version) ProtoMessage()

func (*Version) Reset

func (m *Version) Reset()

func (*Version) Size

func (m *Version) Size() (n int)

func (*Version) String

func (m *Version) String() string

func (*Version) Unmarshal

func (m *Version) Unmarshal(dAtA []byte) error

func (*Version) XXX_DiscardUnknown

func (m *Version) XXX_DiscardUnknown()

func (*Version) XXX_Marshal

func (m *Version) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Version) XXX_Merge

func (m *Version) XXX_Merge(src proto.Message)

func (*Version) XXX_Size

func (m *Version) XXX_Size() int

func (*Version) XXX_Unmarshal

func (m *Version) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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