versionx

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 0 Imported by: 0

README

versionx 包 Package

versionx 定义构建版本元数据和基础兼容性判断。

Use BuildInfo or the VersionInfo alias to expose release metadata in L1 packages.

Documentation

Overview

Package versionx 定义构建版本元数据和兼容性判断。

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildInfo

type BuildInfo struct {
	Module    string `json:"module"`
	Version   string `json:"version"`
	Commit    string `json:"commit"`
	BuildTime string `json:"build_time"`
	GoVersion string `json:"go_version"`
}

func NewBuildInfo

func NewBuildInfo(module, version, commit, buildTime, goVersion string) BuildInfo
Example
package main

import (
	"github.com/ZoneCNH/kernel/versionx"
)

func main() {
	_ = versionx.NewBuildInfo("github.com/ZoneCNH/kernel", "v0.1.0", "local", "2026-06-01T00:00:00Z", "go1.23")
}

type Compatibility

type Compatibility struct {
	Module string
	Major  string
}

func (Compatibility) CompatibleWith

func (c Compatibility) CompatibleWith(info BuildInfo) bool

type VersionInfo

type VersionInfo = BuildInfo

func NewVersionInfo

func NewVersionInfo(module, version, commit, buildTime, goVersion string) VersionInfo

Jump to

Keyboard shortcuts

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