Documentation
¶
Index ¶
- type File
- type GitHubApi
- func (a *GitHubApi) AutoCreateRepository(owner, repoName string, isPrivate bool) (string, error)
- func (a *GitHubApi) CheckTokenIfExpired() bool
- func (a *GitHubApi) DeleteAllFiles(owner, repoName, branch string) error
- func (a *GitHubApi) DeleteFiles(owner, repoName, branch string, folderPaths ...string) error
- func (a *GitHubApi) GetBranch() (branch string)
- func (a *GitHubApi) GetFile(owner, repoName, filePath, ref string) (*File, error)
- func (a *GitHubApi) GetLatestCommitHash(owner, repoName, filePath, ref string) (string, error)
- func (a *GitHubApi) GetRepoApiDomain() (domain string)
- func (a *GitHubApi) GetRepoBranches() ([]string, error)
- func (a *GitHubApi) GetRepoDefaultBranch() (string, error)
- func (a *GitHubApi) GetRepoName() (repoName string)
- func (a *GitHubApi) GetRepoOwner() (repoOwner string)
- func (a *GitHubApi) GetRepositoryArchive(owner, repoName, ref string) ([]byte, error)
- func (a *GitHubApi) GetRepositoryPrivacy(owner, repoName string) (bool, error)
- func (a *GitHubApi) GetToken() (token string)
- func (a *GitHubApi) GetTokenOwner() (tokenOwner string)
- func (a *GitHubApi) ParseFileUrl(url string) (filePid, owner, repoName string, err error)
- func (a *GitHubApi) PushFilesToRepository(files map[string][]byte, owner, repoName, branch, commitMessage string) error
- func (a *GitHubApi) UpdateBranch(branch string)
- func (a *GitHubApi) ValidateRepoBranch(branch string) (bool, error)
- type GitLabApi
- func (a *GitLabApi) AutoCreateRepository(owner, repoName string, isPrivate bool) (string, error)
- func (a *GitLabApi) CheckTokenIfExpired() bool
- func (a *GitLabApi) DeleteAllFiles(owner, repoName, branch string) error
- func (a *GitLabApi) DeleteFiles(owner, repoName, branch string, filePaths ...string) error
- func (a *GitLabApi) GetBranch() (branch string)
- func (a *GitLabApi) GetFile(owner, repoName, filePath, ref string) (*File, error)
- func (a *GitLabApi) GetLatestCommitHash(owner, repoName, filePath, ref string) (string, error)
- func (a *GitLabApi) GetProjectPid() string
- func (a *GitLabApi) GetRepoApiDomain() (domain string)
- func (a *GitLabApi) GetRepoBranches() ([]string, error)
- func (a *GitLabApi) GetRepoDefaultBranch() (string, error)
- func (a *GitLabApi) GetRepoName() (repoName string)
- func (a *GitLabApi) GetRepoOwner() (repoOwner string)
- func (a *GitLabApi) GetRepositoryArchive(owner, repoName, ref string) ([]byte, error)
- func (a *GitLabApi) GetRepositoryPrivacy(owner, repoName string) (bool, error)
- func (a *GitLabApi) GetToken() (token string)
- func (a *GitLabApi) GetTokenOwner() (tokenOwner string)
- func (a *GitLabApi) ParseFileUrl(url string) (filePid, owner, repoName string, err error)
- func (a *GitLabApi) PushFilesToRepository(files map[string][]byte, owner, repoName, branch, commitMessage string) error
- func (a *GitLabApi) UpdateBranch(branch string)
- func (a *GitLabApi) ValidateRepoBranch(branch string) (bool, error)
- type IRepository
- type Manager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitHubApi ¶
type GitHubApi struct {
// contains filtered or unexported fields
}
func NewGitHubApi ¶
func (*GitHubApi) AutoCreateRepository ¶
func (*GitHubApi) CheckTokenIfExpired ¶
func (*GitHubApi) DeleteAllFiles ¶
func (*GitHubApi) DeleteFiles ¶
func (*GitHubApi) GetLatestCommitHash ¶
func (*GitHubApi) GetRepoApiDomain ¶
func (*GitHubApi) GetRepoBranches ¶
func (*GitHubApi) GetRepoDefaultBranch ¶
func (*GitHubApi) GetRepoName ¶
func (*GitHubApi) GetRepoOwner ¶
func (*GitHubApi) GetRepositoryArchive ¶
func (*GitHubApi) GetRepositoryPrivacy ¶
func (*GitHubApi) GetTokenOwner ¶
func (*GitHubApi) ParseFileUrl ¶
func (*GitHubApi) PushFilesToRepository ¶
func (*GitHubApi) UpdateBranch ¶
type GitLabApi ¶
type GitLabApi struct {
// contains filtered or unexported fields
}
func NewGitLabApi ¶
func (*GitLabApi) AutoCreateRepository ¶
func (*GitLabApi) CheckTokenIfExpired ¶
func (*GitLabApi) DeleteAllFiles ¶
func (*GitLabApi) DeleteFiles ¶
func (*GitLabApi) GetLatestCommitHash ¶
func (*GitLabApi) GetProjectPid ¶
func (*GitLabApi) GetRepoApiDomain ¶
func (*GitLabApi) GetRepoBranches ¶
func (*GitLabApi) GetRepoDefaultBranch ¶
func (*GitLabApi) GetRepoName ¶
func (*GitLabApi) GetRepoOwner ¶
func (*GitLabApi) GetRepositoryArchive ¶
func (*GitLabApi) GetRepositoryPrivacy ¶
func (*GitLabApi) GetTokenOwner ¶
func (*GitLabApi) ParseFileUrl ¶
func (*GitLabApi) PushFilesToRepository ¶
func (*GitLabApi) UpdateBranch ¶
type IRepository ¶
type IRepository interface {
GetRepoApiDomain() (domain string)
GetToken() (token string)
GetTokenOwner() (tokenOwner string)
GetRepoOwner() (repoOwner string)
GetRepoName() (repoName string)
GetBranch() (branch string)
UpdateBranch(branch string)
CheckTokenIfExpired() bool
GetRepoDefaultBranch() (string, error)
ValidateRepoBranch(branch string) (bool, error)
GetRepoBranches() ([]string, error)
ParseFileUrl(url string) (filePid, owner, repoName string, err error) // parse file URL to the key message
GetFile(owner, repoName, filePid, ref string) (*File, error) // get a file from a repository
PushFilesToRepository(files map[string][]byte, owner, repoName, branch, commitMessage string) error // push files to the repository
GetRepositoryArchive(owner, repoName, ref string) ([]byte, error) // obtain the byte of the compressed package, gitlab could not specify ref
GetLatestCommitHash(owner, repoName, filePid, ref string) (string, error) // get the latest commit hash for the specified file
DeleteFiles(owner, repoName, branch string, folderPaths ...string) error // delete root dirs
DeleteAllFiles(owner, repoName, branch string) error // delete all repo files
AutoCreateRepository(owner, repoName string, isPrivate bool) (string, error) // automatically create repository and return new repository's URL
GetRepositoryPrivacy(owner, repoName string) (bool, error) // determine if the repository is private
}
Click to show internal directories.
Click to hide internal directories.