git

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clone

func Clone(repo string) error

func ConfigureSecretKey

func ConfigureSecretKey(sk *gpg.SecretKey) error

func GetCommitMessage

func GetCommitMessage(commit string, dir string) (string, error)

func GetCommitTime

func GetCommitTime(commit string, dir string) (*time.Time, error)

func GetCommitVerificationMessage

func GetCommitVerificationMessage(commit string, dir string) (string, error)

Types

type Author

type Author struct {
	Name  string `json:"name"`
	Email string `json:"email"`
	Date  string `json:"date"`
}

type Commit

type Commit struct {
	Commit           string    `json:"commit"`
	Time             time.Time `json:"time"`
	Message          string    `json:"message"`
	VerificationFlag string    `json:"verification_flag"`
	Signer           string    `json:"signer"`
	SignerKey        string    `json:"signer_key"`
	Author           Author    `json:"author"`
	Commiter         Author    `json:"commiter"`
}

func (*Commit) Verification

func (c *Commit) Verification() string

func (*Commit) VerificationStatus

func (c *Commit) VerificationStatus() emoji.Emoji

show "G" for a good (valid) signature, "B" for a bad signature, "U" for a good signature with unknown validity, "X" for a good signature that has expired, "Y" for a good signature made by an expired key, "R" for a good signature made by a revoked key, "E" if the signature cannot be checked (e.g. missing key) and "N" for no signature

type Commits

type Commits []Commit

func ListCommits

func ListCommits(dir string) (Commits, error)

func UnmarshalCommits

func UnmarshalCommits(data []byte) (Commits, error)

func (*Commits) Marshal

func (r *Commits) Marshal() ([]byte, error)

type LocalRepo

type LocalRepo struct {
	Repo *url.URL
}

func NewLocalDir

func NewLocalDir(repo string) (*LocalRepo, error)

func (*LocalRepo) CreateIfNotExist

func (l *LocalRepo) CreateIfNotExist() error

func (*LocalRepo) Exist

func (l *LocalRepo) Exist() bool

func (*LocalRepo) IsGithub

func (l *LocalRepo) IsGithub() bool

func (*LocalRepo) Path

func (l *LocalRepo) Path() string

func (*LocalRepo) SSHAddress

func (l *LocalRepo) SSHAddress() string

type Tag

type Tag struct {
	Time     *time.Time
	CommitID string
	Name     string
}

func ListTags

func ListTags(dir string) ([]*Tag, error)

Jump to

Keyboard shortcuts

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