Documentation ¶
Index ¶
- func ConstructProvidersPath(providersFolderPath string, providerName string) string
- func GetProviderPath(providerName string) (providerPath string, err error)
- func GetProvidersFolder() (providerPath string, err error)
- func InitialiseProviders(config *configuration.Configuration) (err error)
- type GitProvider
- func (provider *GitProvider) CancelPullRequest(repositoryName string, pullRequestId string) error
- func (provider *GitProvider) CheckoutBranch(path string, branchName string) error
- func (provider *GitProvider) CheckoutNewBranch(path string, branchName string) error
- func (provider *GitProvider) CloneRepository(repositoryName string, path string) error
- func (provider *GitProvider) Close()
- func (provider *GitProvider) CreatePullRequest(repositoryName string, title string, sourceBranchName string, ...) (pullRequestId string, err error)
- func (provider *GitProvider) CreateRepository(repositoryName string) error
- func (provider *GitProvider) FetchRemotes(path string) error
- func (provider *GitProvider) GetAllRepositories() (repositories []Repository, err error)
- func (provider *GitProvider) GetRepositoryNames() (names []string, err error)
- func (provider *GitProvider) MergePullRequest(repositoryName string, pullRequestId string) error
- func (provider *GitProvider) RepositoryExists(repositoryName string) (exists bool, err error)
- type Repository
- type StreamWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConstructProvidersPath ¶
ConstructProvidersPath takes in the provider folder path and the provider name and returns the combined file path with a `.exe` extension if on Windows.
func GetProviderPath ¶
GetProviderPath returns the path to the executable for a specific named provider
func GetProvidersFolder ¶
GetProviderPath returns the path to the folder where the provider executables have been initialised. In project folders it would be `${project}/.solo/providers` and in Git repositories it would be in `./.solo/providers`.
func InitialiseProviders ¶
func InitialiseProviders(config *configuration.Configuration) (err error)
InitialiseProviders downloads or copies all the Solo Providers found in the configuration to the Providers directory.
Types ¶
type GitProvider ¶
type GitProvider struct {
// contains filtered or unexported fields
}
GitProvider defines the abstraction wrapper for all functions to interact with the Git Provider implementation as configured in the .solo/config.yml file.
func NewGitProvider ¶
func NewGitProvider(configuration *configuration.Configuration) (provider *GitProvider, err error)
NewGitProvider instantiates and returns a new GitProvider object by starting the initialised GitProvider executable with a randomised port number to start the gRPC server.
func (*GitProvider) CancelPullRequest ¶
func (provider *GitProvider) CancelPullRequest(repositoryName string, pullRequestId string) error
CancelPullRequest cancels an existing pull request
func (*GitProvider) CheckoutBranch ¶
func (provider *GitProvider) CheckoutBranch(path string, branchName string) error
CheckoutBranch checks out an existing branch for a local Git directory.
func (*GitProvider) CheckoutNewBranch ¶
func (provider *GitProvider) CheckoutNewBranch(path string, branchName string) error
CheckoutNewBranch checks out a new branch for a local Git directory.
func (*GitProvider) CloneRepository ¶
func (provider *GitProvider) CloneRepository(repositoryName string, path string) error
CloneRepository clones a repository with the specified name into the specified local folder path.
func (*GitProvider) Close ¶
func (provider *GitProvider) Close()
Close terminates the connection to the Git gRPC server.
func (*GitProvider) CreatePullRequest ¶
func (provider *GitProvider) CreatePullRequest(repositoryName string, title string, sourceBranchName string, targetBranchName string) (pullRequestId string, err error)
CreatePullRequest creates a new pull request
func (*GitProvider) CreateRepository ¶
func (provider *GitProvider) CreateRepository(repositoryName string) error
CreateRepository creates a new repository with the specified name.
func (*GitProvider) FetchRemotes ¶
func (provider *GitProvider) FetchRemotes(path string) error
FetchRemotes performs a Git fetch on a local Git directory.
func (*GitProvider) GetAllRepositories ¶
func (provider *GitProvider) GetAllRepositories() (repositories []Repository, err error)
GetAllRepositories returns a list of all the Repository objects in the associated Git Provider.
func (*GitProvider) GetRepositoryNames ¶
func (provider *GitProvider) GetRepositoryNames() (names []string, err error)
GetRepositorNames returns a list of all the Git repository names.
func (*GitProvider) MergePullRequest ¶
func (provider *GitProvider) MergePullRequest(repositoryName string, pullRequestId string) error
MergePullRequest merges an existing pull request
func (*GitProvider) RepositoryExists ¶
func (provider *GitProvider) RepositoryExists(repositoryName string) (exists bool, err error)
RepositoryExists checks if the repository exists.
type Repository ¶
type Repository struct { // Name is the name of the Git repository Name string // HttpsUrl is the URL which can be used to clone the repository using the // HTTPS protocol HttpsUrl string // SshUrl is the URL which can be used to clone the repository using the // SSH protocol SshUrl string }
Repository contains information about a Git repository.
type StreamWriter ¶
type StreamWriter struct {
// contains filtered or unexported fields
}
StreamWriter writes a stream to a logging function and prefixes each line with a prefix string. StreamWriter implements the io.Writer interface.
func NewStreamWriter ¶
func NewStreamWriter(logFunction func(string, ...interface{}), prefix string) *StreamWriter
NewStreamWriter returns a newly initialised StreamWriter
func (*StreamWriter) Close ¶
func (this *StreamWriter) Close() error
func (*StreamWriter) Flush ¶
func (this *StreamWriter) Flush() error
func (*StreamWriter) OutputLines ¶
func (this *StreamWriter) OutputLines() (err error)