git

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ReposDirectory = "repos"
)

Functions

func AddAll

func AddAll(gistTmpId string) error

func CatFileBatch added in v1.6.0

func CatFileBatch(user string, gist string, revision string, truncate bool) ([]*catFileBatch, error)

func CloneTmp

func CloneTmp(user string, gist string, gistTmpId string, email string, remove bool) error

func CommitRepository

func CommitRepository(gistTmpId string, authorName string, authorEmail string) error

func CommitToBare added in v1.7.0

func CommitToBare(t *testing.T, user string, gist string, files map[string]string)

func CountCommits added in v1.5.0

func CountCommits(user string, gist string) (string, error)

func CreateDotGitFiles added in v1.6.0

func CreateDotGitFiles(user string, gist string) error

func DeleteRepository

func DeleteRepository(user string, gist string) error

func ForkClone

func ForkClone(userSrc string, gistSrc string, userDst string, gistDst string) error

func GcRepos added in v1.5.0

func GcRepos() error

func GetFileContent

func GetFileContent(user string, gist string, revision string, filename string, truncate bool) (string, bool, error)

func GetFileSize added in v1.6.0

func GetFileSize(user string, gist string, revision string, filename string) (uint64, error)

func GetFilesOfRepository

func GetFilesOfRepository(user string, gist string, revision string) ([]string, error)

func GetGitVersion

func GetGitVersion() (string, error)

func HasNoCommits added in v1.5.0

func HasNoCommits(user string, gist string) (bool, error)

func InitRepository

func InitRepository(user string, gist string) error

func LastHashOfCommit added in v1.7.0

func LastHashOfCommit(t *testing.T, user string, gist string) string

func Push

func Push(gistTmpId string) error

func RPC

func RPC(user string, gist string, service string) ([]byte, error)

func RepositoryPath

func RepositoryPath(user string, gist string) string

func RepositoryUrl added in v1.5.0

func RepositoryUrl(ctx echo.Context, user string, gist string) string

func SetFileContent

func SetFileContent(gistTmpId string, filename string, content string) error

func SetupTest added in v1.7.0

func SetupTest(t *testing.T)

func TeardownTest added in v1.7.0

func TeardownTest(t *testing.T)

func TmpRepositoriesPath

func TmpRepositoriesPath() string

func TmpRepositoryPath

func TmpRepositoryPath(gistId string) string

func UpdateServerInfo

func UpdateServerInfo(user string, gist string) error

Types

type Commit

type Commit struct {
	Hash        string
	AuthorName  string
	AuthorEmail string
	Timestamp   string
	Changed     string
	Files       []File
}

func GetLog

func GetLog(user string, gist string, skip int) ([]*Commit, error)

type CsvFile

type CsvFile struct {
	File
	Header []string
	Rows   [][]string
}

func ParseCsv

func ParseCsv(file *File) (*CsvFile, error)

type File

type File struct {
	Filename    string `json:"filename"`
	Size        uint64 `json:"size"`
	HumanSize   string `json:"human_size"`
	OldFilename string `json:"-"`
	Content     string `json:"content"`
	Truncated   bool   `json:"truncated"`
	IsCreated   bool   `json:"-"`
	IsDeleted   bool   `json:"-"`
}

type RevisionNotFoundError added in v1.6.0

type RevisionNotFoundError struct{}

func (*RevisionNotFoundError) Error added in v1.6.0

func (m *RevisionNotFoundError) Error() string

Jump to

Keyboard shortcuts

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