Documentation ¶
Index ¶
- func WithAuthorization(username, password, token string) uhttp.RequestOption
- func WithAuthorizationBearerHeader(token string) uhttp.RequestOption
- func WithSetBasicAuthHeader(username, password string) uhttp.RequestOption
- func WithSetBearerAuthHeader(token string) uhttp.RequestOption
- type BitbucketError
- type DataCenterClient
- func (d *DataCenterClient) AddUserToGroups(ctx context.Context, groupName, userName string) error
- func (d *DataCenterClient) CheckCredentials() bool
- func (d *DataCenterClient) GetGlobalGroupPermissions(ctx context.Context, startPage, limit string) ([]GroupsPermissions, Page, error)
- func (d *DataCenterClient) GetGlobalUserPermissions(ctx context.Context, startPage, limit string) ([]UsersPermissions, Page, error)
- func (d *DataCenterClient) GetGroupMembers(ctx context.Context, startPage, limit, groupName string) ([]Members, Page, error)
- func (d *DataCenterClient) GetGroupProjectsPermissions(ctx context.Context, startPage, limit, projectKey string) ([]GroupsPermissions, Page, error)
- func (d *DataCenterClient) GetGroupRepositoryPermissions(ctx context.Context, startPage, limit, projectKey, repositorySlug string) ([]GroupsPermissions, Page, error)
- func (d *DataCenterClient) GetGroups(ctx context.Context, startPage, limit string) ([]string, Page, error)
- func (d *DataCenterClient) GetProjects(ctx context.Context, startPage, limit string) ([]Projects, Page, error)
- func (d *DataCenterClient) GetRepos(ctx context.Context, startPage, limit string) ([]Repos, Page, error)
- func (d *DataCenterClient) GetUserProjectsPermissions(ctx context.Context, startPage, limit, projectKey string) ([]UsersPermissions, Page, error)
- func (d *DataCenterClient) GetUserRepositoryPermissions(ctx context.Context, startPage, limit, projectKey, repositorySlug string) ([]UsersPermissions, Page, error)
- func (d *DataCenterClient) GetUsers(ctx context.Context, startPage, limit string) ([]Users, Page, error)
- func (d *DataCenterClient) IsBasicAuthentication() bool
- func (d *DataCenterClient) IsTokenAuthentication() bool
- func (d *DataCenterClient) ListGlobalGroupPermissions(ctx context.Context, opts PageOptions) ([]GroupsPermissions, string, error)
- func (d *DataCenterClient) ListGlobalUserPermissions(ctx context.Context, opts PageOptions) ([]UsersPermissions, string, error)
- func (d *DataCenterClient) ListGroupMembers(ctx context.Context, opts PageOptions, groupName string) ([]Members, string, error)
- func (d *DataCenterClient) ListGroupProjectsPermissions(ctx context.Context, opts PageOptions, projectKey string) ([]GroupsPermissions, string, error)
- func (d *DataCenterClient) ListGroupRepositoryPermissions(ctx context.Context, opts PageOptions, projectKey, repositorySlug string) ([]GroupsPermissions, string, error)
- func (d *DataCenterClient) ListGroups(ctx context.Context, opts PageOptions) ([]string, string, error)
- func (d *DataCenterClient) ListProjects(ctx context.Context, opts PageOptions) ([]Projects, string, error)
- func (d *DataCenterClient) ListRepos(ctx context.Context, opts PageOptions) ([]Repos, string, error)
- func (d *DataCenterClient) ListUserProjectsPermissions(ctx context.Context, opts PageOptions, projectKey string) ([]UsersPermissions, string, error)
- func (d *DataCenterClient) ListUserRepositoryPermissions(ctx context.Context, opts PageOptions, projectKey, repositorySlug string) ([]UsersPermissions, string, error)
- func (d *DataCenterClient) ListUsers(ctx context.Context, opts PageOptions) ([]Users, string, error)
- func (d *DataCenterClient) RemoveUserFromGroup(ctx context.Context, userName, groupName string) error
- func (d *DataCenterClient) RevokeGroupProjectPermission(ctx context.Context, projectKey, groupName string) error
- func (d *DataCenterClient) RevokeGroupRepositoryPermission(ctx context.Context, projectKey, repositorySlug, groupName string) error
- func (d *DataCenterClient) RevokeUserProjectPermission(ctx context.Context, projectKey, userName string) error
- func (d *DataCenterClient) RevokeUserRepositoryPermission(ctx context.Context, projectKey, repositorySlug, userName string) error
- func (d *DataCenterClient) UpdateGroupProjectPermission(ctx context.Context, projectKey, groupName, permission string) error
- func (d *DataCenterClient) UpdateGroupRepositoryPermission(ctx context.Context, projectKey, repositorySlug, groupName, permission string) error
- func (d *DataCenterClient) UpdateUserProjectPermission(ctx context.Context, projectKey, userName, permission string) error
- func (d *DataCenterClient) UpdateUserRepositoryPermission(ctx context.Context, projectKey, repositorySlug, userName, permission string) error
- func (d *DataCenterClient) WithBearerToken(bitbucketToken string) *DataCenterClient
- func (d *DataCenterClient) WithPassword(bitbucketPassword string) *DataCenterClient
- func (d *DataCenterClient) WithUser(bitbucketUsername string) *DataCenterClient
- type GlobalGroupPermissionsAPIData
- type GlobalPermissionsAPIData
- type GroupPermissionsAPIData
- type Groups
- type GroupsAPIData
- type GroupsPermissions
- type Members
- type MembersAPIData
- type Page
- type PageOptions
- type ProjectSelf
- type Projects
- type ProjectsAPIData
- type Repos
- type ReposAPIData
- type UserSelf
- type Users
- type UsersAPIData
- type UsersPermissions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithAuthorization ¶
func WithAuthorization(username, password, token string) uhttp.RequestOption
func WithAuthorizationBearerHeader ¶
func WithAuthorizationBearerHeader(token string) uhttp.RequestOption
func WithSetBasicAuthHeader ¶
func WithSetBasicAuthHeader(username, password string) uhttp.RequestOption
func WithSetBearerAuthHeader ¶
func WithSetBearerAuthHeader(token string) uhttp.RequestOption
Types ¶
type BitbucketError ¶ added in v0.0.3
type BitbucketError struct { ErrorMessage string `json:"error"` ErrorDescription string `json:"error_description"` ErrorCode int `json:"errorCode,omitempty"` ErrorSummary string `json:"errorSummary,omitempty" toml:"error_description"` ErrorLink string `json:"errorLink,omitempty"` ErrorId string `json:"errorId,omitempty"` ErrorCauses []map[string]interface{} `json:"errorCauses,omitempty"` }
func (*BitbucketError) Error ¶ added in v0.0.3
func (b *BitbucketError) Error() string
type DataCenterClient ¶
type DataCenterClient struct {
// contains filtered or unexported fields
}
func New ¶
func New(ctx context.Context, baseUrl string, bitbucketClient *DataCenterClient) (*DataCenterClient, error)
func NewClient ¶
func NewClient() *DataCenterClient
func (*DataCenterClient) AddUserToGroups ¶
func (d *DataCenterClient) AddUserToGroups(ctx context.Context, groupName, userName string) error
AddUserToGroups Add a user to one or more groups. https://developer.atlassian.com/server/bitbucket/rest/v819/api-group-permission-management/#api-api-latest-admin-users-add-groups-post
func (*DataCenterClient) CheckCredentials ¶
func (d *DataCenterClient) CheckCredentials() bool
func (*DataCenterClient) GetGlobalGroupPermissions ¶
func (d *DataCenterClient) GetGlobalGroupPermissions(ctx context.Context, startPage, limit string) ([]GroupsPermissions, Page, error)
func (*DataCenterClient) GetGlobalUserPermissions ¶
func (d *DataCenterClient) GetGlobalUserPermissions(ctx context.Context, startPage, limit string) ([]UsersPermissions, Page, error)
GetGlobalUserPermissions Get users with a global permission https://developer.atlassian.com/server/bitbucket/rest/v819/api-group-permission-management/#api-api-latest-admin-permissions-users-get
func (*DataCenterClient) GetGroupMembers ¶
func (d *DataCenterClient) GetGroupMembers(ctx context.Context, startPage, limit, groupName string) ([]Members, Page, error)
GetGroupMembers Get group members. The authenticated user must have the LICENSED_USER permission to call this resource. https://developer.atlassian.com/server/bitbucket/rest/v819/api-group-permission-management/#api-api-latest-admin-groups-more-members-get
func (*DataCenterClient) GetGroupProjectsPermissions ¶
func (d *DataCenterClient) GetGroupProjectsPermissions(ctx context.Context, startPage, limit, projectKey string) ([]GroupsPermissions, Page, error)
func (*DataCenterClient) GetGroupRepositoryPermissions ¶
func (d *DataCenterClient) GetGroupRepositoryPermissions(ctx context.Context, startPage, limit, projectKey, repositorySlug string) ([]GroupsPermissions, Page, error)
func (*DataCenterClient) GetGroups ¶
func (d *DataCenterClient) GetGroups(ctx context.Context, startPage, limit string) ([]string, Page, error)
GetGroups Get groups. The authenticated user must have LICENSED_USER permission or higher to call this resource. https://developer.atlassian.com/server/bitbucket/rest/v819/api-group-permission-management/#api-api-latest-admin-groups-get
func (*DataCenterClient) GetProjects ¶
func (d *DataCenterClient) GetProjects(ctx context.Context, startPage, limit string) ([]Projects, Page, error)
GetProjects Get projects. Only projects for which the authenticated user has the PROJECT_VIEW permission will be returned. https://developer.atlassian.com/server/bitbucket/rest/v819/api-group-project/#api-api-latest-projects-get
func (*DataCenterClient) GetUserProjectsPermissions ¶
func (d *DataCenterClient) GetUserProjectsPermissions(ctx context.Context, startPage, limit, projectKey string) ([]UsersPermissions, Page, error)
func (*DataCenterClient) GetUserRepositoryPermissions ¶
func (d *DataCenterClient) GetUserRepositoryPermissions(ctx context.Context, startPage, limit, projectKey, repositorySlug string) ([]UsersPermissions, Page, error)
GetUserRepositoryPermissions Get users with permission to repository https://developer.atlassian.com/server/bitbucket/rest/v819/api-group-permission-management/#api-api-latest-projects-projectkey-repos-repositoryslug-permissions-users-get
func (*DataCenterClient) GetUsers ¶
func (d *DataCenterClient) GetUsers(ctx context.Context, startPage, limit string) ([]Users, Page, error)
GetUsers Get all users. Only authenticated users may call this resource. https://developer.atlassian.com/server/bitbucket/rest/v819/api-group-system-maintenance/#api-api-latest-users-get
func (*DataCenterClient) IsBasicAuthentication ¶ added in v0.0.3
func (d *DataCenterClient) IsBasicAuthentication() bool
func (*DataCenterClient) IsTokenAuthentication ¶ added in v0.0.3
func (d *DataCenterClient) IsTokenAuthentication() bool
func (*DataCenterClient) ListGlobalGroupPermissions ¶
func (d *DataCenterClient) ListGlobalGroupPermissions(ctx context.Context, opts PageOptions) ([]GroupsPermissions, string, error)
func (*DataCenterClient) ListGlobalUserPermissions ¶
func (d *DataCenterClient) ListGlobalUserPermissions(ctx context.Context, opts PageOptions) ([]UsersPermissions, string, error)
func (*DataCenterClient) ListGroupMembers ¶
func (d *DataCenterClient) ListGroupMembers(ctx context.Context, opts PageOptions, groupName string) ([]Members, string, error)
func (*DataCenterClient) ListGroupProjectsPermissions ¶
func (d *DataCenterClient) ListGroupProjectsPermissions(ctx context.Context, opts PageOptions, projectKey string) ([]GroupsPermissions, string, error)
func (*DataCenterClient) ListGroupRepositoryPermissions ¶
func (d *DataCenterClient) ListGroupRepositoryPermissions(ctx context.Context, opts PageOptions, projectKey, repositorySlug string) ([]GroupsPermissions, string, error)
func (*DataCenterClient) ListGroups ¶
func (d *DataCenterClient) ListGroups(ctx context.Context, opts PageOptions) ([]string, string, error)
func (*DataCenterClient) ListProjects ¶
func (d *DataCenterClient) ListProjects(ctx context.Context, opts PageOptions) ([]Projects, string, error)
func (*DataCenterClient) ListRepos ¶
func (d *DataCenterClient) ListRepos(ctx context.Context, opts PageOptions) ([]Repos, string, error)
func (*DataCenterClient) ListUserProjectsPermissions ¶
func (d *DataCenterClient) ListUserProjectsPermissions(ctx context.Context, opts PageOptions, projectKey string) ([]UsersPermissions, string, error)
func (*DataCenterClient) ListUserRepositoryPermissions ¶
func (d *DataCenterClient) ListUserRepositoryPermissions(ctx context.Context, opts PageOptions, projectKey, repositorySlug string) ([]UsersPermissions, string, error)
func (*DataCenterClient) ListUsers ¶
func (d *DataCenterClient) ListUsers(ctx context.Context, opts PageOptions) ([]Users, string, error)
func (*DataCenterClient) RemoveUserFromGroup ¶
func (d *DataCenterClient) RemoveUserFromGroup(ctx context.Context, userName, groupName string) error
RemoveUserFromGroup Remove user from group https://developer.atlassian.com/server/bitbucket/rest/v819/api-group-permission-management/#api-api-latest-admin-users-remove-group-post
func (*DataCenterClient) RevokeGroupProjectPermission ¶
func (d *DataCenterClient) RevokeGroupProjectPermission(ctx context.Context, projectKey, groupName string) error
RevokeGroupProjectPermission Revoke group project permission. https://developer.atlassian.com/server/bitbucket/rest/v819/api-group-project/#api-api-latest-projects-projectkey-permissions-groups-delete
func (*DataCenterClient) RevokeGroupRepositoryPermission ¶
func (d *DataCenterClient) RevokeGroupRepositoryPermission(ctx context.Context, projectKey, repositorySlug, groupName string) error
RevokeGroupRepositoryPermission Revoke group repository permission https://developer.atlassian.com/server/bitbucket/rest/v819/api-group-permission-management/#api-api-latest-projects-projectkey-repos-repositoryslug-permissions-groups-delete
func (*DataCenterClient) RevokeUserProjectPermission ¶
func (d *DataCenterClient) RevokeUserProjectPermission(ctx context.Context, projectKey, userName string) error
RevokeUserProjectPermission Revoke user project permission https://developer.atlassian.com/server/bitbucket/rest/v819/api-group-project/#api-api-latest-projects-projectkey-permissions-users-delete
func (*DataCenterClient) RevokeUserRepositoryPermission ¶
func (d *DataCenterClient) RevokeUserRepositoryPermission(ctx context.Context, projectKey, repositorySlug, userName string) error
RevokeUserRepositoryPermission Revoke user repository permission https://developer.atlassian.com/server/bitbucket/rest/v819/api-group-permission-management/#api-api-latest-projects-projectkey-repos-repositoryslug-permissions-users-delete
func (*DataCenterClient) UpdateGroupProjectPermission ¶
func (d *DataCenterClient) UpdateGroupProjectPermission(ctx context.Context, projectKey, groupName, permission string) error
UpdateGroupProjectPermission Update group project permission. Available project permissions are: PROJECT_READ, PROJECT_WRITE, PROJECT_ADMIN https://developer.atlassian.com/server/bitbucket/rest/v819/api-group-project/#api-api-latest-projects-projectkey-permissions-groups-put
func (*DataCenterClient) UpdateGroupRepositoryPermission ¶
func (d *DataCenterClient) UpdateGroupRepositoryPermission(ctx context.Context, projectKey, repositorySlug, groupName, permission string) error
UpdateGroupRepositoryPermission Update group repository permission https://developer.atlassian.com/server/bitbucket/rest/v819/api-group-permission-management/#api-api-latest-projects-projectkey-repos-repositoryslug-permissions-groups-put
func (*DataCenterClient) UpdateUserProjectPermission ¶
func (d *DataCenterClient) UpdateUserProjectPermission(ctx context.Context, projectKey, userName, permission string) error
UpdateUserProjectPermission Update user project permission. Available project permissions are: PROJECT_READ, PROJECT_WRITE, PROJECT_ADMIN https://developer.atlassian.com/server/bitbucket/rest/v819/api-group-project/#api-api-latest-projects-projectkey-permissions-users-put
func (*DataCenterClient) UpdateUserRepositoryPermission ¶
func (d *DataCenterClient) UpdateUserRepositoryPermission(ctx context.Context, projectKey, repositorySlug, userName, permission string) error
UpdateUserRepositoryPermission Update user repository permission https://developer.atlassian.com/server/bitbucket/rest/v819/api-group-permission-management/#api-api-latest-projects-projectkey-repos-repositoryslug-permissions-users-put
func (*DataCenterClient) WithBearerToken ¶
func (d *DataCenterClient) WithBearerToken(bitbucketToken string) *DataCenterClient
func (*DataCenterClient) WithPassword ¶
func (d *DataCenterClient) WithPassword(bitbucketPassword string) *DataCenterClient
func (*DataCenterClient) WithUser ¶
func (d *DataCenterClient) WithUser(bitbucketUsername string) *DataCenterClient
type GlobalGroupPermissionsAPIData ¶
type GlobalGroupPermissionsAPIData struct { Size int `json:"size,omitempty"` Limit int `json:"limit,omitempty"` IsLastPage bool `json:"isLastPage,omitempty"` GroupsPermissions []GroupsPermissions `json:"values,omitempty"` Start int `json:"start,omitempty"` NextPageStart int `json:"nextPageStart,omitempty"` }
type GlobalPermissionsAPIData ¶
type GlobalPermissionsAPIData struct { Size int `json:"size,omitempty"` Limit int `json:"limit,omitempty"` IsLastPage bool `json:"isLastPage,omitempty"` UsersPermissions []UsersPermissions `json:"values,omitempty"` Start int `json:"start,omitempty"` NextPageStart int `json:"nextPageStart,omitempty"` }
type GroupPermissionsAPIData ¶
type GroupPermissionsAPIData struct { Size int `json:"size,omitempty"` Limit int `json:"limit,omitempty"` IsLastPage bool `json:"isLastPage,omitempty"` GroupsPermissions []GroupsPermissions `json:"values,omitempty"` Start int `json:"start,omitempty"` NextPageStart int `json:"nextPageStart,omitempty"` }
type GroupsAPIData ¶
type GroupsPermissions ¶
type Members ¶
type Members struct { Name string `json:"name,omitempty"` EmailAddress string `json:"emailAddress,omitempty"` Active bool `json:"active,omitempty"` DisplayName string `json:"displayName,omitempty"` ID int `json:"id,omitempty"` Slug string `json:"slug,omitempty"` Type string `json:"type,omitempty"` DirectoryName string `json:"directoryName,omitempty"` Deletable bool `json:"deletable,omitempty"` MutableDetails bool `json:"mutableDetails,omitempty"` MutableGroups bool `json:"mutableGroups,omitempty"` Links UserSelf `json:"links,omitempty"` }
type MembersAPIData ¶
type Page ¶
type Page struct { PreviousPage *string `json:"previous_page"` NextPage *string `json:"nextPageStart"` Count int64 `json:"size"` }
Page is base struct for resource pagination.
type PageOptions ¶
PageOptions is options for list method of paginatable resources. It's used to create query string.
type ProjectSelf ¶
type ProjectSelf struct {
Self any `json:"self,omitempty"`
}
type ProjectsAPIData ¶
type Repos ¶
type Repos struct { Slug string `json:"slug,omitempty"` ID int `json:"id,omitempty"` Name string `json:"name,omitempty"` HierarchyId string `json:"hierarchyId,omitempty"` ScmId string `json:"scmId,omitempty"` State string `json:"state,omitempty"` StatusMessage string `json:"statusMessage,omitempty"` Forkable bool `json:"forkable,omitempty"` Project Projects `json:"project,omitempty"` }
type ReposAPIData ¶
type Users ¶
type Users struct { Name string `json:"name,omitempty"` EmailAddress string `json:"emailAddress,omitempty"` Active bool `json:"active,omitempty"` DisplayName string `json:"displayName,omitempty"` ID int `json:"id,omitempty"` Slug string `json:"slug,omitempty"` Type string `json:"type,omitempty"` Links UserSelf `json:"links,omitempty"` }