version

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DirName = ".versions"

Variables

View Source
var Regex = regexp.MustCompile(`v?\d+\.\d+\.\d+`)

Functions

func Cat added in v0.1.2

func Cat(path string, w io.Writer, options ...opts.PrintOp) (int, error)

func Clean

func Clean(version string) string

func Fprint added in v0.1.2

func Fprint(w io.Writer, version string, options ...opts.PrintOp) (int, error)

func Fprintln added in v0.1.2

func Fprintln(w io.Writer, version string, options ...opts.PrintOp) (int, error)

func Init

func Init(ctx context.Context, name string, src Source, options ...opts.InitOp) (err error)

func IsPath added in v0.1.2

func IsPath(name string) bool

func MakefileVar added in v0.1.2

func MakefileVar(name string) string

func Prefixed added in v0.1.2

func Prefixed(name string) string

func Print added in v0.1.2

func Print(version string, options ...opts.PrintOp) (int, error)

func PrintIfPath added in v0.1.2

func PrintIfPath(path string) (int, error)

func Println added in v0.1.2

func Println(version string, options ...opts.PrintOp) (int, error)

func Read added in v0.1.2

func Read(name string, options ...opts.ReadOp) (string, error)

func ReadFile

func ReadFile(path string, options ...opts.ReadOp) (string, error)

func RelPath

func RelPath(name string) string

func WriteMakefile added in v0.1.2

func WriteMakefile(name string, options ...opts.WriteOp) error

Types

type GitHub

type GitHub string

func (GitHub) Latest

func (g GitHub) Latest(context.Context) (string, error)

Latest implements Source.

func (GitHub) Name

func (g GitHub) Name(context.Context) (string, error)

Name implements Source.

type Source

type Source interface {
	Latest(context.Context) (string, error)
	Name(context.Context) (string, error)
}

func GuessSource

func GuessSource(s string) (Source, error)

type String

type String string

func (String) Latest

func (s String) Latest(context.Context) (string, error)

Latest implements Source.

func (String) Name

func (s String) Name(context.Context) (string, error)

Name implements Source.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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