repo

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 18, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckProtocal

func CheckProtocal(v config.Repo) string

func CloneOnNotExist

func CloneOnNotExist(repo config.Repo) error

CloneOnNotExist clone repo not exist locally

func GetRepoName

func GetRepoName(repo config.Repo) string

func IsDuplcatedRepo

func IsDuplcatedRepo(repos []config.Repo) (bool, error)

check if repo dupl in config

func LocalRepoAddr

func LocalRepoAddr(repo config.Repo) string

Returns repo addr locally

func Pull

func Pull(dst string, opts ...PullOptions) error

Pull pulls updates for the repository.

func RunScript

func RunScript(repo config.Repo) (string, error)

func SearchRepo

func SearchRepo(ID string) (config.Repo, error)

Types

type CloneOptions

type CloneOptions struct {
	//hook type
	Type string
	//specify protocol
	Protocol string
	// Indicates whether the repository should be cloned as a mirror.
	Mirror bool
	// sshkey used for clone.
	Sshkey string
	// Indicates whether the repository should be cloned in bare format.
	Bare bool
	// Indicates whether to suppress the log output.
	Quiet bool
	// The branch to checkout for the working tree when Bare=false.
	Branch string
	//Under http protocol
	Username string
	Password string
	//token (github)
	Token string
	// The number of revisions to clone.
	Depth uint64
	// The timeout duration before giving up for each shell command execution. The
	// default timeout duration will be used when not supplied.
	Timeout time.Duration
}

Gogs code under mit.

type PullOptions

type PullOptions struct {
	//specify protocol
	Protocol string
	// Indicates whether to rebased during pulling.
	Rebase bool
	//
	Type string
	// sshkey used for clone.
	Sshkey string
	//Under http protocol
	Username string
	Password string
	//github only
	Token string
	// Indicates whether to pull from all remotes.
	All bool
	// The remote to pull updates from when All=false.
	Remote string
	// The branch to pull updates from when All=false and Remote is supplied.
	Branch string
	// The timeout duration before giving up for each shell command execution. The
	// default timeout duration will be used when not supplied.
	Timeout time.Duration
}

type UncriticalError

type UncriticalError struct {
	Uerror error
	ID     string
}

Errors that does not infect cicd.

func CheckRepoConfig

func CheckRepoConfig(repoarray []config.Repo) (string, []UncriticalError, error)

this checks if any attr is empty.

Jump to

Keyboard shortcuts

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