git

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateGitHubBlobSHA added in v0.10.0

func CalculateGitHubBlobSHA(fileContent []byte) string

Types

type CommitInfo

type CommitInfo struct {
	CommitMsg    string
	CommitBranch string
	GitFileMap   GitFileContentMap
}

type GitFileContentMap

type GitFileContentMap map[string][]byte

type GitFilePathInfo

type GitFilePathInfo struct {
	SourcePath      string
	DestinationPath string
}

GitFilePathInfo contains file local path and remote git path

type RepoFileStatus

type RepoFileStatus struct {
	Path   string
	SHA    string
	Branch string
}

func (*RepoFileStatus) EncodeToGitHubContentOption

func (f *RepoFileStatus) EncodeToGitHubContentOption(commitMsg string) *github.RepositoryContentFileOptions

type RepoInfo

type RepoInfo struct {
	// repo detail fields
	Owner    string `yaml:"owner" mapstructure:"owner,omitempty"`
	Org      string `yaml:"org" mapstructure:"org,omitempty"`
	Repo     string `yaml:"name" mapstructure:"name,omitempty"`
	Branch   string `yaml:"branch" mapstructure:"branch,omitempty"`
	RepoType string `yaml:"scmType" mapstructure:"scmType,omitempty"`
	Token    string `yaml:"token" mapstructure:"token,omitempty"`

	// url fields
	APIURL   string `yaml:"apiURL" mapstructure:"apiURL,omitempty"`
	CloneURL ScmURL `yaml:"url" mapstructure:"url,omitempty"`

	// used for gitlab
	Namespace     string `mapstructure:"nameSpace,omitempty"`
	Visibility    string `mapstructure:"visibility,omitempty"`
	BaseURL       string `yaml:"baseURL" mapstructure:"baseURL,omitempty"`
	SSHPrivateKey string `yaml:"sshPrivateKey" mapstructure:"sshPrivateKey,omitempty"`

	// used for GitHub
	WorkPath string `mapstructure:"workPath,omitempty"`
	NeedAuth bool   `mapstructure:"needAuth,omitempty"`
}

func (*RepoInfo) Encode added in v0.10.0

func (r *RepoInfo) Encode() map[string]any

func (*RepoInfo) GetCloneURL added in v0.10.3

func (r *RepoInfo) GetCloneURL() string

func (*RepoInfo) GetRepoName added in v0.10.3

func (r *RepoInfo) GetRepoName() string

func (*RepoInfo) GetRepoOwner

func (r *RepoInfo) GetRepoOwner() string

func (*RepoInfo) GetRepoPath

func (r *RepoInfo) GetRepoPath() string

func (*RepoInfo) IsGithubRepo added in v0.10.3

func (r *RepoInfo) IsGithubRepo() bool

IsGithubRepo return ture if repo is github

func (*RepoInfo) SetDefault added in v0.10.3

func (r *RepoInfo) SetDefault() error

type ScmURL added in v0.10.3

type ScmURL string

type WebhookConfig

type WebhookConfig struct {
	Address     string
	SecretToken string
}

Jump to

Keyboard shortcuts

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