revision

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GetVersion = sync.OnceValue(func() string {
	return fmt.Sprintf("%s-%s", VersionString, getCommit())
})
View Source
var Systems = map[string]System{}
View Source
var (
	VersionString = "v0.4" // Only updated for major/minor releases.
)

Functions

This section is empty.

Types

type GitRepo

type GitRepo struct {
	*git.Repository
}

func (GitRepo) Fetch

func (r GitRepo) Fetch(ctx context.Context) (err error)

func (GitRepo) Head

func (r GitRepo) Head() (Reference, error)

func (GitRepo) RemoteHead

func (r GitRepo) RemoteHead() (Reference, error)

func (GitRepo) RemoteURL

func (r GitRepo) RemoteURL() (string, error)

func (GitRepo) System

func (GitRepo) System() string

func (GitRepo) Update

func (r GitRepo) Update() error

type GitSystem

type GitSystem struct{}

func (GitSystem) Name

func (s GitSystem) Name() string

func (GitSystem) Open

func (s GitSystem) Open(path string) (Repo, error)

type Reference

type Reference struct {
	Branch  string `json:"branch"`
	Hash    string `json:"hash"`
	Author  string `json:"author"`
	Message string `json:"message"`
}

type Repo

type Repo interface {
	System() string
	Head() (Reference, error)
	RemoteHead() (Reference, error)
	RemoteURL() (string, error)
	Fetch(ctx context.Context) error
	Update() error
}

func Open

func Open(path string) (r Repo, err error)

type System

type System interface {
	Name() string
	Open(path string) (Repo, error)
}

Jump to

Keyboard shortcuts

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