Documentation
¶
Index ¶
- Constants
- func PushInitRepo(client ClientOperation, commitInfo *git.CommitInfo) error
- type ClientOperation
- type MockScmClient
- func (m *MockScmClient) AddRepoSecret(secretKey, secretValue string) error
- func (m *MockScmClient) AddWebhook(webhookConfig *git.WebhookConfig) error
- func (m *MockScmClient) DeleteFiles(commitInfo *git.CommitInfo) error
- func (m *MockScmClient) DeleteRepo() error
- func (m *MockScmClient) DeleteWebhook(webhookConfig *git.WebhookConfig) error
- func (m *MockScmClient) DescribeRepo() (*git.RepoInfo, error)
- func (m *MockScmClient) DownloadRepo() (string, error)
- func (m *MockScmClient) GetPathInfo(path string) ([]*git.RepoFileStatus, error)
- func (m *MockScmClient) InitRepo() error
- func (m *MockScmClient) PushFiles(commitInfo *git.CommitInfo, checkUpdate bool) (bool, error)
- type SCMInfo
Constants ¶
View Source
const ( DefaultCommitMsg = "init with devstream" TransitBranch = "init-with-devstream" )
Variables ¶
This section is empty.
Functions ¶
func PushInitRepo ¶
func PushInitRepo(client ClientOperation, commitInfo *git.CommitInfo) error
Types ¶
type ClientOperation ¶
type ClientOperation interface { InitRepo() error DeleteRepo() error DownloadRepo() (string, error) DescribeRepo() (*git.RepoInfo, error) PushFiles(commitInfo *git.CommitInfo, checkUpdate bool) (bool, error) DeleteFiles(commitInfo *git.CommitInfo) error GetPathInfo(path string) ([]*git.RepoFileStatus, error) AddWebhook(webhookConfig *git.WebhookConfig) error DeleteWebhook(webhookConfig *git.WebhookConfig) error AddRepoSecret(secretKey, secretValue string) error }
func NewClientWithAuth ¶ added in v0.10.0
func NewClientWithAuth(repoInfo *git.RepoInfo) (ClientOperation, error)
type MockScmClient ¶ added in v0.10.0
type MockScmClient struct { InitRaiseError error PushRaiseError error GetPathInfoError error DownloadRepoError error AddRepoSecretError error DownloadRepoValue string NeedRollBack bool DeleteFuncIsRun bool GetPathInfoReturnValue []*git.RepoFileStatus }
func (*MockScmClient) AddRepoSecret ¶ added in v0.10.0
func (m *MockScmClient) AddRepoSecret(secretKey, secretValue string) error
func (*MockScmClient) AddWebhook ¶ added in v0.10.0
func (m *MockScmClient) AddWebhook(webhookConfig *git.WebhookConfig) error
func (*MockScmClient) DeleteFiles ¶ added in v0.10.0
func (m *MockScmClient) DeleteFiles(commitInfo *git.CommitInfo) error
func (*MockScmClient) DeleteRepo ¶ added in v0.10.0
func (m *MockScmClient) DeleteRepo() error
func (*MockScmClient) DeleteWebhook ¶ added in v0.10.0
func (m *MockScmClient) DeleteWebhook(webhookConfig *git.WebhookConfig) error
func (*MockScmClient) DescribeRepo ¶ added in v0.10.0
func (m *MockScmClient) DescribeRepo() (*git.RepoInfo, error)
func (*MockScmClient) DownloadRepo ¶ added in v0.10.0
func (m *MockScmClient) DownloadRepo() (string, error)
func (*MockScmClient) GetPathInfo ¶ added in v0.10.0
func (m *MockScmClient) GetPathInfo(path string) ([]*git.RepoFileStatus, error)
func (*MockScmClient) InitRepo ¶ added in v0.10.0
func (m *MockScmClient) InitRepo() error
func (*MockScmClient) PushFiles ¶ added in v0.10.0
func (m *MockScmClient) PushFiles(commitInfo *git.CommitInfo, checkUpdate bool) (bool, error)
type SCMInfo ¶ added in v0.10.0
type SCMInfo struct { // SCM URL related info CloneURL string `mapstructure:"url,omitempty" yaml:"url"` APIURL string `mapstructure:"apiURL,omitempty" yaml:"apiURL"` // SCM Basic related info Owner string `yaml:"owner" mapstructure:"owner,omitempty"` Org string `yaml:"org" mapstructure:"org,omitempty"` Name string `yaml:"name" mapstructure:"name,omitempty"` Type string `mapstructure:"scmType,omitempty" yaml:"scmType"` // common fields Branch string `mapstructure:"branch,omitempty" yaml:"branch"` SSHPrivateKey string `mapstructure:"sshPrivateKey,omitempty"` }
SCMInfo can use BasicRepo and URLRepo to get scm info
func (*SCMInfo) BuildRepoInfo ¶ added in v0.10.0
BuildRepoInfo will return RepoInfo from SCMInfo
func (*SCMInfo) NewClientWithAuthFromScm ¶ added in v0.10.2
func (s *SCMInfo) NewClientWithAuthFromScm() (ClientOperation, error)
Click to show internal directories.
Click to hide internal directories.