lib

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BaseUrl = "https://api.github.com/repos/python/cpython/tags?per_page=100&page=%d"
)

Variables

View Source
var (
	ConfigPath  string
	WithVerbose int
)
View Source
var (
	SkipConfirm bool
)

Functions

func CleanCache

func CleanCache() error

func Confirm

func Confirm(str string) bool

func InstallPython

func InstallPython(config Config, version Version, needLatest bool) error

func PrintVersionMap

func PrintVersionMap(vm map[int]Version)

func PrintVersions

func PrintVersions(vs []Version)

func ReadConfig added in v0.0.2

func ReadConfig(path string, config *Config) error

func StatusCommand

func StatusCommand(config Config) error

func UninstallPython

func UninstallPython(config Config, version Version) error

func UpdateAll

func UpdateAll(config Config) error

func UpdateLatest

func UpdateLatest(config Config, version Version) error

func YesOrNo

func YesOrNo(f bool) string

Types

type Config

type Config struct {
	AllowPreRelease            bool
	ForAllUser                 bool
	TargetDirectory            string
	AdditionalInstallerOptions map[string]string
}

type Tag

type Tag struct {
	Name   string `json:"name"`
	Commit struct {
		Sha string `json:"sha"`
		Url string `json:"url"`
	} `json:"commit"`
	ZipballUrl string `json:"zipball_url"`
	TarballUrl string `json:"tarball_url"`
	NodeId     string `json:"node_id"`
}

type Version

type Version struct {
	Major  int
	Minor  int
	Micro  int
	Pre    int
	PreNum int
}

func NewVersion

func NewVersion(versionString string) (Version, error)

func (Version) Compare

func (v Version) Compare(o Version) int

func (Version) Count

func (v Version) Count() int

Count return: if ?.0.0 -> 1 if ?.?.0 -> 2 if ?.?.? -> 3 if ?.?.?[a,b,rc]? -> 4

func (Version) Equal

func (v Version) Equal(o Version) bool

Equal v == o

func (Version) GreaterThan

func (v Version) GreaterThan(o Version) bool

GreaterThan v > o

func (Version) GreaterThanOrEqual

func (v Version) GreaterThanOrEqual(o Version) bool

GreaterThanOrEqual v >= o

func (Version) LessThan

func (v Version) LessThan(o Version) bool

LessThan v < o

func (Version) LessThanOrEqual

func (v Version) LessThanOrEqual(o Version) bool

LessThanOrEqual v <= o

func (Version) MarshalJSON

func (v Version) MarshalJSON() ([]byte, error)

func (*Version) Set

func (v *Version) Set(val string) error

func (Version) String

func (v Version) String() string

func (Version) Type

func (v Version) Type() string

func (*Version) UnmarshalJSON

func (v *Version) UnmarshalJSON(data []byte) error

type VersionCache

type VersionCache struct {
	UpdateDate            time.Time       `json:"update_date"`
	AllVersions           []Version       `json:"versions"`
	FailedMinimumVersions map[int]Version `json:"failed_minimum_versions"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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