Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNotFound ¶
IsNotFound returns true if the error represents a NotFound response from an upstream service.
Types ¶
type ClientFactory ¶
type ClientFactory interface { // Create creates a new client, using the provided token for authentication. Create(url, token string) (SCM, error) }
ClientFactory is an interface for creating SCM clients based on the URL to be fetched.
type SCM ¶
type SCM interface { // FileContents returns the contents of a file within a repo. FileContents(ctx context.Context, repo, path, ref string) ([]byte, error) }
SCM is a wrapper around go-scm's Client implementation.
type SCMClient ¶
SCMClient is a wrapper for the go-scm scm.Client with a simplified API.
func (*SCMClient) FileContents ¶
FileContents reads the specific revision of a file from a repository.
If an HTTP error is returned by the upstream service, an error with the response status code is returned.
type SCMClientFactory ¶
type SCMClientFactory struct {
// contains filtered or unexported fields
}
SCMClientFactory is an implementation of the GitClientFactory interface that can create clients based on go-scm.
func NewClientFactory ¶
func NewClientFactory(m metrics.Interface) *SCMClientFactory
NewClientFactory creates and returns an SCMClientFactory.