Versions in this module Expand all Collapse all v0 v0.2.1 Aug 5, 2021 Changes in this version + const IdentityTypeOrganization + const IdentityTypeSuborganization + const IdentityTypeUser + const LicenseTemplateApache2 + const LicenseTemplateGPL3 + const LicenseTemplateMIT + const RepositoryPermissionAdmin + const RepositoryPermissionMaintain + const RepositoryPermissionPull + const RepositoryPermissionPush + const RepositoryPermissionTriage + const RepositoryVisibilityInternal + const RepositoryVisibilityPrivate + const RepositoryVisibilityPublic + const TransportTypeGit + const TransportTypeHTTPS + const TransportTypeSSH + var ErrAlreadyExists = errors.New(...) + var ErrDestructiveCallDisallowed = errors.New("destructive call was blocked, disallowed by client") + var ErrDomainUnsupported = errors.New("the client doesn't support handling requests for this domain") + var ErrInvalidArgument = errors.New("invalid argument specified") + var ErrInvalidClientOptions = errors.New("invalid options given to NewClient()") + var ErrInvalidPermissionLevel = errors.New("invalid permission level") + var ErrInvalidServerData = errors.New("got invalid data from server, don't know how to handle") + var ErrInvalidTransportChainReturn = errors.New("the return value of a ChainableRoundTripperFunc must not be nil") + var ErrMissingHeader = errors.New("header is missing") + var ErrNoProviderSupport = errors.New("no provider support for this feature") + var ErrNotFound = errors.New("the requested resource was not found") + var ErrNotTopLevelOrganization = errors.New("expected top-level organization, received sub-organization instead") + var ErrURLInvalid = errors.New("invalid organization, user or repository URL") + var ErrURLMissingRepoName = errors.New("missing repository name") + var ErrURLUnsupportedParts = errors.New("URL cannot have fragments, query values nor user information") + var ErrURLUnsupportedScheme = errors.New("unsupported URL scheme, only HTTPS supported") + var ErrUnexpectedEvent = errors.New("an unexpected error occurred") + func BoolVar(b bool) *bool + func BuildClientFromTransportChain(chain []ChainableRoundTripperFunc) (*http.Client, error) + func GetCloneURL(rs RepositoryRef, transport TransportType) string + func GetDomainURL(d string) string + func StringVar(s string) *string + func ValidateAndDefaultInfo(info DefaultedInfoRequest) error + func ValidateLicenseTemplate(t LicenseTemplate) error + func ValidateRepositoryPermission(p RepositoryPermission) error + func ValidateRepositoryVisibility(r RepositoryVisibility) error + type BranchClient interface + Create func(ctx context.Context, branch, sha string) error + List func(ctx context.Context) ([]string, error) + type ChainableRoundTripperFunc func(in http.RoundTripper) (out http.RoundTripper) + type Client interface + HasTokenPermission func(ctx context.Context, permission TokenPermission) (bool, error) + ProviderID func() ProviderID + Raw func() interface{} + SupportedDomain func() string + type Commit interface + Get func() CommitInfo + type CommitClient interface + Create func(ctx context.Context, branch string, message string, files []CommitFile) (Commit, error) + ListPage func(ctx context.Context, branch string, perPage int, page int) ([]Commit, error) + type CommitFile struct + Content *string + Path *string + type CommitInfo struct + Sha string + TreeSha string + type CommonClientOptions struct + Domain *string + EnableDestructiveAPICalls *bool + PostChainTransportHook ChainableRoundTripperFunc + PreChainTransportHook ChainableRoundTripperFunc + func (opts *CommonClientOptions) ApplyToCommonClientOptions(target *CommonClientOptions) error + type DefaultedInfoRequest interface + Default func() + type Deletable interface + Delete func(ctx context.Context) error + type DeployKey interface + Get func() DeployKeyInfo + Set func(DeployKeyInfo) error + type DeployKeyClient interface + Create func(ctx context.Context, req DeployKeyInfo) (DeployKey, error) + Get func(ctx context.Context, name string) (DeployKey, error) + List func(ctx context.Context) ([]DeployKey, error) + Reconcile func(ctx context.Context, req DeployKeyInfo) (resp DeployKey, actionTaken bool, err error) + type DeployKeyInfo struct + Key []byte + Name string + ReadOnly *bool + func (dk *DeployKeyInfo) Default() + func (dk DeployKeyInfo) Equals(actual InfoRequest) bool + func (dk DeployKeyInfo) ValidateInfo() error + type HTTPError struct + DocumentationURL string + ErrorMessage string + Message string + Response *http.Response + func (e *HTTPError) Error() string + type IdentityRef interface + GetDomain func() string + GetIdentity func() string + GetType func() IdentityType + String func() string + type IdentityType string + type InfoRequest interface + Equals func(actual InfoRequest) bool + ValidateInfo func() error + type InvalidCredentialsError struct + type LicenseTemplate string + func LicenseTemplateVar(t LicenseTemplate) *LicenseTemplate + type Object interface + APIObject func() interface{} + type OrgRepositoriesClient interface + Create func(ctx context.Context, r OrgRepositoryRef, req RepositoryInfo, ...) (OrgRepository, error) + Get func(ctx context.Context, r OrgRepositoryRef) (OrgRepository, error) + List func(ctx context.Context, o OrganizationRef) ([]OrgRepository, error) + Reconcile func(ctx context.Context, r OrgRepositoryRef, req RepositoryInfo, ...) (resp OrgRepository, actionTaken bool, err error) + type OrgRepository interface + TeamAccess func() TeamAccessClient + type OrgRepositoryRef struct + RepositoryName string + func ParseOrgRepositoryURL(r string) (*OrgRepositoryRef, error) + func (r OrgRepositoryRef) GetCloneURL(transport TransportType) string + func (r OrgRepositoryRef) GetRepository() string + func (r OrgRepositoryRef) String() string + func (r OrgRepositoryRef) ValidateFields(validator validation.Validator) + type Organization interface + Get func() OrganizationInfo + Teams func() TeamsClient + type OrganizationBound interface + Organization func() OrganizationRef + type OrganizationInfo struct + Description *string + Name *string + type OrganizationRef struct + Domain string + Organization string + SubOrganizations []string + func ParseOrganizationURL(o string) (*OrganizationRef, error) + func (o OrganizationRef) GetDomain() string + func (o OrganizationRef) GetIdentity() string + func (o OrganizationRef) GetType() IdentityType + func (o OrganizationRef) String() string + func (o OrganizationRef) ValidateFields(validator validation.Validator) + type OrganizationsClient interface + Children func(ctx context.Context, o OrganizationRef) ([]Organization, error) + Get func(ctx context.Context, o OrganizationRef) (Organization, error) + List func(ctx context.Context) ([]Organization, error) + type ProviderID string + type PullRequest interface + Get func() PullRequestInfo + type PullRequestClient interface + Create func(ctx context.Context, title, branch, baseBranch, description string) (PullRequest, error) + type PullRequestInfo struct + WebURL string + type RateLimitError struct + Limit int + Remaining int + Reset time.Time + type Reconcilable interface + Reconcile func(ctx context.Context) (actionTaken bool, err error) + type RepositoryBound interface + Repository func() RepositoryRef + type RepositoryCreateOption interface + ApplyToRepositoryCreateOptions func(target *RepositoryCreateOptions) + type RepositoryCreateOptions struct + AutoInit *bool + LicenseTemplate *LicenseTemplate + func MakeRepositoryCreateOptions(opts ...RepositoryCreateOption) (RepositoryCreateOptions, error) + func (opts *RepositoryCreateOptions) ApplyToRepositoryCreateOptions(target *RepositoryCreateOptions) + func (opts *RepositoryCreateOptions) ValidateOptions() error + type RepositoryInfo struct + DefaultBranch *string + Description *string + Visibility *RepositoryVisibility + func (r *RepositoryInfo) Default() + func (r RepositoryInfo) Equals(actual InfoRequest) bool + func (r RepositoryInfo) ValidateInfo() error + type RepositoryPermission string + func RepositoryPermissionVar(p RepositoryPermission) *RepositoryPermission + type RepositoryReconcileOption interface + type RepositoryRef interface + GetCloneURL func(transport TransportType) string + GetRepository func() string + type RepositoryVisibility string + func RepositoryVisibilityVar(r RepositoryVisibility) *RepositoryVisibility + type ResourceClient interface + OrgRepositories func() OrgRepositoriesClient + Organizations func() OrganizationsClient + UserRepositories func() UserRepositoriesClient + type Team interface + Get func() TeamInfo + type TeamAccess interface + Get func() TeamAccessInfo + Set func(TeamAccessInfo) error + type TeamAccessClient interface + Create func(ctx context.Context, req TeamAccessInfo) (TeamAccess, error) + Get func(ctx context.Context, name string) (TeamAccess, error) + List func(ctx context.Context) ([]TeamAccess, error) + Reconcile func(ctx context.Context, req TeamAccessInfo) (resp TeamAccess, actionTaken bool, err error) + type TeamAccessInfo struct + Name string + Permission *RepositoryPermission + func (ta *TeamAccessInfo) Default() + func (ta TeamAccessInfo) Equals(actual InfoRequest) bool + func (ta TeamAccessInfo) ValidateInfo() error + type TeamInfo struct + Members []string + Name string + type TeamsClient interface + Get func(ctx context.Context, name string) (Team, error) + List func(ctx context.Context) ([]Team, error) + type TokenPermission int + const TokenPermissionRWRepository + type TransportType string + type Updatable interface + Update func(ctx context.Context) error + type UserRef struct + Domain string + UserLogin string + func ParseUserURL(u string) (*UserRef, error) + func (u UserRef) GetDomain() string + func (u UserRef) GetIdentity() string + func (u UserRef) GetType() IdentityType + func (u UserRef) String() string + func (u UserRef) ValidateFields(validator validation.Validator) + type UserRepositoriesClient interface + Create func(ctx context.Context, r UserRepositoryRef, req RepositoryInfo, ...) (UserRepository, error) + Get func(ctx context.Context, r UserRepositoryRef) (UserRepository, error) + List func(ctx context.Context, o UserRef) ([]UserRepository, error) + Reconcile func(ctx context.Context, r UserRepositoryRef, req RepositoryInfo, ...) (resp UserRepository, actionTaken bool, err error) + type UserRepository interface + Branches func() BranchClient + Commits func() CommitClient + DeployKeys func() DeployKeyClient + Get func() RepositoryInfo + PullRequests func() PullRequestClient + Set func(RepositoryInfo) error + type UserRepositoryRef struct + RepositoryName string + func ParseUserRepositoryURL(r string) (*UserRepositoryRef, error) + func (r UserRepositoryRef) GetCloneURL(transport TransportType) string + func (r UserRepositoryRef) GetRepository() string + func (r UserRepositoryRef) String() string + func (r UserRepositoryRef) ValidateFields(validator validation.Validator) + type ValidationError struct + Errors []ValidationErrorItem + type ValidationErrorItem struct + Code string + Field string + Message string + Resource string