Documentation ¶
Index ¶
Constants ¶
const ( // GitHub the name used in a Uses Git URI to reference a git server GitHub = "github" // Lighthouse the name used in a Uses Git URI to reference the git server lighthouse is configured to run against Lighthouse = "lighthouse" // GitHubURL the github server URL GitHubURL = "https://github.com" )
Variables ¶
This section is empty.
Functions ¶
func GetMainAndCurrentBranchRefs ¶
func GetMainAndCurrentBranchRefs(scmClient scmProviderClient, fullName, eventRef string) ([]string, error)
GetMainAndCurrentBranchRefs a function to return the main branch then the eventRef
Types ¶
type FileBrowsers ¶ added in v0.0.920
type FileBrowsers struct {
// contains filtered or unexported fields
}
FileBrowsers contains the file browsers for the supported git servers
func NewFileBrowsers ¶ added in v0.0.920
func NewFileBrowsers(serverURL string, fb Interface) (*FileBrowsers, error)
NewFileBrowsers creates a new file browsers service for the lighthouse git server URL and file browser if the current server URL is not github.com then creates a second file browser so that we can use the uses: Git URI syntax for accessing github resources as well as to access the lighthouse git server too
func (*FileBrowsers) GetFileBrowser ¶ added in v0.0.920
func (f *FileBrowsers) GetFileBrowser(name string) Interface
GetFileBrowser returns the file browser for the given git server name.
func (*FileBrowsers) GitHubFileBrowser ¶ added in v0.0.920
func (f *FileBrowsers) GitHubFileBrowser() Interface
GitHubFileBrowser returns a git file browser for github.com
func (*FileBrowsers) LighthouseGitFileBrowser ¶ added in v0.0.920
func (f *FileBrowsers) LighthouseGitFileBrowser() Interface
LighthouseGitFileBrowser returns the git file browser for the git server that lighthouse is configured against
type Interface ¶
type Interface interface { // GetMainAndCurrentBranchRefs returns the main branch then the ref value if its different GetMainAndCurrentBranchRefs(owner, repo, ref string) ([]string, error) // GetFile returns a file from the given path in the repository with the given sha GetFile(owner, repo, path, ref string) ([]byte, error) // ListFiles returns the file and directory entries in the given path in the repository with the given sha ListFiles(owner, repo, path, ref string) ([]*scm.FileEntry, error) }
Interface an interface to represent browsing files in a repository
func NewFileBrowserFromGitClient ¶
func NewFileBrowserFromGitClient(clientFactory git.ClientFactory) Interface
NewFileBrowserFromGitClient creates a new file browser from an Scm client
func NewFileBrowserFromScmClient ¶
func NewFileBrowserFromScmClient(scmClient scmProviderClient) Interface
NewFileBrowserFromScmClient creates a new file browser from an Scm client