Documentation ¶
Index ¶
- Variables
- func FromRepoURL(repoURL string) (*scm.Client, error)
- func NewClient(driver, serverURL, oauthToken string, opts ...ClientOptionFunc) (*scm.Client, error)
- func NewClientFromEnvironment() (*scm.Client, error)
- func NewClientWithBasicAuth(driver, serverURL, user, password string, opts ...ClientOptionFunc) (*scm.Client, error)
- func NewWebHookService(driver string) (scm.WebhookService, error)
- type AuthOptions
- type ClientOptionFunc
- type HostDriverIdentifier
- type MappingFunc
Constants ¶
This section is empty.
Variables ¶
var DefaultIdentifier = NewDriverIdentifier()
DefaultIdentifier is the default driver identifier used by FromRepoURL.
var ErrMissingGitServerURL = fmt.Errorf("No git serverURL was specified")
ErrMissingGitServerURL the error returned if you use a git driver that needs a git server URL
Functions ¶
func FromRepoURL ¶ added in v1.5.151
FromRepoURL parses a URL of the form https://:authtoken@host/ and attempts to determine the driver and creates a client to authenticate to the endpoint.
func NewClient ¶
func NewClient(driver, serverURL, oauthToken string, opts ...ClientOptionFunc) (*scm.Client, error)
NewClient creates a new client for a given driver, serverURL and OAuth token
func NewClientFromEnvironment ¶ added in v1.5.18
NewClientFromEnvironment creates a new client using environment variables $GIT_KIND, $GIT_SERVER, $GIT_TOKEN defaulting to github if no $GIT_KIND or $GIT_SERVER
func NewClientWithBasicAuth ¶ added in v1.5.173
func NewClientWithBasicAuth(driver, serverURL, user, password string, opts ...ClientOptionFunc) (*scm.Client, error)
NewClientWithBasicAuth creates a new client for a given driver, serverURL and basic auth
func NewWebHookService ¶ added in v1.5.152
func NewWebHookService(driver string) (scm.WebhookService, error)
NewWebHookService creates a new instance of the webhook service without the rest of the client
Types ¶
type AuthOptions ¶ added in v1.9.3
type AuthOptions struct {
// contains filtered or unexported fields
}
type ClientOptionFunc ¶ added in v1.5.187
ClientOptionFunc is a function taking a client as its argument
func Client ¶ added in v1.5.84
func Client(httpClient *http.Client) ClientOptionFunc
Client creates a new client with the given HTTP client
func SetUsername ¶ added in v1.6.2
func SetUsername(username string) ClientOptionFunc
SetUsername allows the username to be set
type HostDriverIdentifier ¶ added in v1.5.151
HostDriverIdentifier is a mapping of hostname to scm driver.
func NewDriverIdentifier ¶ added in v1.5.151
func NewDriverIdentifier(extras ...MappingFunc) HostDriverIdentifier
NewDriverIdentifier creates and returns a new HostDriverIdentifier.
type MappingFunc ¶ added in v1.5.151
type MappingFunc func(HostDriverIdentifier)
MappingFunc is a type for adding names to the list of mappings from hosts to drivers.
func Mapping ¶ added in v1.5.151
func Mapping(host, driver string) MappingFunc
Mapping adds a host,driver combination to the DriverIdentifier.