version

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DirName = ".versions"

Variables

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

Functions

func Clean

func Clean(version string) string

func Init

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

func ReadFile

func ReadFile(name string, options ...Option) (string, error)

func RelPath

func RelPath(name string) string

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 Option

type Option func(*Options)

func WithFs

func WithFs(fs afero.Fs) Option

type Options

type Options struct {
	// contains filtered or unexported fields
}

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.

Jump to

Keyboard shortcuts

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