git

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: AGPL-3.0 Imports: 15 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 CloneTmp

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

func CommitRepository

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

func CountCommits added in v1.5.0

func CountCommits(user string, gist string) (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 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 InitRepositoryViaInit added in v1.5.0

func InitRepositoryViaInit(user string, gist string, ctx echo.Context) error

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 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
	OldFilename string
	Content     string
	Truncated   bool
	IsCreated   bool
	IsDeleted   bool
}

Jump to

Keyboard shortcuts

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