git

package
v1.13.2 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package git provides the models of Git such as a repository and branch.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlobSHA

type BlobSHA string

BlobSHA represents a pointer to a blob.

type BranchName

type BranchName string

BranchName represents name of a branch.

func (BranchName) QualifiedName

func (b BranchName) QualifiedName() RefQualifiedName

QualifiedName returns RefQualifiedName. If the BranchName is empty, it returns a zero value.

type CommitAuthor

type CommitAuthor struct {
	Name  string
	Email string
}

CommitAuthor represents an author of commit.

type CommitMessage

type CommitMessage string

CommitMessage represents a message of a commit.

type CommitSHA

type CommitSHA string

CommitSHA represents a pointer to a commit.

type File

type File struct {
	Filename   string  // filename (including path separators)
	BlobSHA    BlobSHA // blob SHA
	Executable bool    // if the file is executable
}

File represents a file in a tree.

func (*File) Mode

func (f *File) Mode() string

Mode returns mode of the file, i.e. 100644 or 100755.

type NewBlob

type NewBlob struct {
	Repository RepositoryID
	Content    string // base64 encoded content
}

NewBlob represents a blob.

type NewBranch

type NewBranch struct {
	Repository RepositoryID
	BranchName BranchName
	CommitSHA  CommitSHA
}

NewBranch represents a branch.

type NewCommit

type NewCommit struct {
	Repository      RepositoryID
	Message         CommitMessage
	Author          *CommitAuthor // optional
	Committer       *CommitAuthor // optional
	ParentCommitSHA CommitSHA     // optional
	TreeSHA         TreeSHA
}

NewCommit represents a commit.

type NewTree

type NewTree struct {
	Repository  RepositoryID
	BaseTreeSHA TreeSHA
	Files       []File
}

NewTree represents a tree.

type RefName

type RefName string

RefName represents name of a ref, that is a branch or a tag. This may be simple name or qualified name.

type RefQualifiedName

type RefQualifiedName struct {
	Prefix string
	Name   string
}

RefQualifiedName represents qualified name of a ref, e.g. refs/heads/master.

func (RefQualifiedName) IsValid

func (r RefQualifiedName) IsValid() bool

func (RefQualifiedName) String

func (r RefQualifiedName) String() string

type Release

type Release struct {
	ID              ReleaseID
	TagName         TagName
	TargetCommitish string // branch name or commit SHA
	Name            string
}

Release represents a release associated to a tag.

type ReleaseAsset

type ReleaseAsset struct {
	Release  ReleaseID
	Name     string
	RealPath string
}

ReleaseAsset represents a release asset.

type ReleaseID

type ReleaseID struct {
	Repository RepositoryID
	InternalID int64 // GitHub API will allocate this ID
}

ReleaseID represents an ID of release.

type RepositoryID

type RepositoryID struct {
	Owner string
	Name  string
}

RepositoryID represents a pointer to a repository.

func (RepositoryID) IsValid

func (id RepositoryID) IsValid() bool

IsValid returns true if owner and name is not empty.

func (RepositoryID) String

func (id RepositoryID) String() string

type TagName

type TagName string

TagName represents name of a tag.

func (TagName) Name

func (t TagName) Name() string

Name returns the name of tag.

func (TagName) QualifiedName

func (t TagName) QualifiedName() RefQualifiedName

QualifiedName returns RefQualifiedName. If the TagName is empty, it returns a zero value.

type TreeSHA

type TreeSHA string

TreeSHA represents a pointer to a tree.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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