Documentation ¶
Index ¶
- Constants
- type Auth
- type BitbucketError
- type DataCenterClient
- func (d *DataCenterClient) AddUserToGroups(ctx context.Context, groupName, userName string) error
- func (d *DataCenterClient) Do(ctx context.Context, method string, uri *url.URL, body interface{}, ...) (*http.Response, error)
- func (d *DataCenterClient) GetGlobalGroupPermissions(ctx context.Context, pToken *pagination.Token) ([]GroupsPermissions, string, error)
- func (d *DataCenterClient) GetGlobalUserPermissions(ctx context.Context, pToken *pagination.Token) ([]UsersPermissions, string, error)
- func (d *DataCenterClient) GetGroupMembers(ctx context.Context, groupName string, pToken *pagination.Token) ([]Members, string, error)
- func (d *DataCenterClient) GetGroupProjectsPermissions(ctx context.Context, projectKey string, pToken *pagination.Token) ([]GroupsPermissions, string, error)
- func (d *DataCenterClient) GetGroupRepositoryPermissions(ctx context.Context, projectKey, repositorySlug string, ...) ([]GroupsPermissions, string, error)
- func (d *DataCenterClient) GetGroupUsers(ctx context.Context, group string) ([]User, error)
- func (d *DataCenterClient) GetGroups(ctx context.Context, pToken *pagination.Token) ([]string, string, error)
- func (d *DataCenterClient) GetProjects(ctx context.Context, pToken *pagination.Token) ([]Projects, string, error)
- func (d *DataCenterClient) GetRepos(ctx context.Context, pToken *pagination.Token) ([]Repos, string, error)
- func (d *DataCenterClient) GetUserProjectsPermissions(ctx context.Context, projectKey string, pToken *pagination.Token) ([]UsersPermissions, string, error)
- func (d *DataCenterClient) GetUserRepositoryPermissions(ctx context.Context, projectKey, repositorySlug string, ...) ([]UsersPermissions, string, error)
- func (d *DataCenterClient) GetUsers(ctx context.Context, pToken *pagination.Token) ([]User, string, error)
- func (d *DataCenterClient) MakeURL(ctx context.Context, path string, queryParams map[string]string) (*url.URL, error)
- func (d *DataCenterClient) RemoveUserFromGroup(ctx context.Context, userName, groupName string) error
- func (d *DataCenterClient) RevokeGroupGlobalPermission(ctx context.Context, 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) RevokeUserGlobalPermission(ctx context.Context, userName 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) UpdateGroupGlobalPermission(ctx context.Context, groupName, permission 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) UpdateUserGlobalPermission(ctx context.Context, userName, 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) WithAuthorization() uhttp.RequestOption
- type GlobalGroupPermissionsAPIData
- type GlobalPermissionsAPIData
- type GroupPermissionsAPIData
- type Groups
- type GroupsAPIData
- type GroupsPermissions
- type Members
- type MembersAPIData
- type ProjectSelf
- type Projects
- type ProjectsAPIData
- type Repos
- type ReposAPIData
- type User
- type UserSelf
- type UsersAPIData
- type UsersPermissions
Constants ¶
const ITEMSPERPAGE = 1000
To fetch 1000 results https://confluence.atlassian.com/bitbucketserverkb/how-to-apply-the-limit-filter-in-bitbucket-server-and-datacenter-rest-api-and-query-more-than-the-max-limit-of-1000-results-1142440445.html
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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 GetCustomErr ¶ added in v0.0.9
func (*BitbucketError) Error ¶ added in v0.0.3
func (b *BitbucketError) Error() string
type DataCenterClient ¶
type DataCenterClient struct {
// contains filtered or unexported fields
}
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) GetGlobalGroupPermissions ¶
func (d *DataCenterClient) GetGlobalGroupPermissions(ctx context.Context, pToken *pagination.Token) ([]GroupsPermissions, string, error)
func (*DataCenterClient) GetGlobalUserPermissions ¶
func (d *DataCenterClient) GetGlobalUserPermissions(ctx context.Context, pToken *pagination.Token) ([]UsersPermissions, string, 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, groupName string, pToken *pagination.Token) ([]Members, string, 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, projectKey string, pToken *pagination.Token) ([]GroupsPermissions, string, error)
func (*DataCenterClient) GetGroupRepositoryPermissions ¶
func (d *DataCenterClient) GetGroupRepositoryPermissions(ctx context.Context, projectKey, repositorySlug string, pToken *pagination.Token) ([]GroupsPermissions, string, error)
func (*DataCenterClient) GetGroupUsers ¶ added in v0.1.6
func (*DataCenterClient) GetGroups ¶
func (d *DataCenterClient) GetGroups(ctx context.Context, pToken *pagination.Token) ([]string, string, 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, pToken *pagination.Token) ([]Projects, string, error)
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) GetRepos ¶
func (d *DataCenterClient) GetRepos(ctx context.Context, pToken *pagination.Token) ([]Repos, string, error)
func (*DataCenterClient) GetUserProjectsPermissions ¶
func (d *DataCenterClient) GetUserProjectsPermissions(ctx context.Context, projectKey string, pToken *pagination.Token) ([]UsersPermissions, string, error)
func (*DataCenterClient) GetUserRepositoryPermissions ¶
func (d *DataCenterClient) GetUserRepositoryPermissions(ctx context.Context, projectKey, repositorySlug string, pToken *pagination.Token) ([]UsersPermissions, string, 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, pToken *pagination.Token) ([]User, string, error)
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) 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) RevokeGroupGlobalPermission ¶ added in v0.1.0
func (d *DataCenterClient) RevokeGroupGlobalPermission(ctx context.Context, groupName string) error
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) RevokeUserGlobalPermission ¶ added in v0.1.0
func (d *DataCenterClient) RevokeUserGlobalPermission(ctx context.Context, userName string) error
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) UpdateGroupGlobalPermission ¶ added in v0.1.0
func (d *DataCenterClient) UpdateGroupGlobalPermission(ctx context.Context, groupName, permission string) error
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 The authenticated user must have REPO_ADMIN permission for the specified repository or a higher project or global permission to call this resource. https://developer.atlassian.com/server/bitbucket/rest/v819/api-group-permission-management/#api-api-latest-projects-projectkey-repos-repositoryslug-permissions-groups-put
func (*DataCenterClient) UpdateUserGlobalPermission ¶ added in v0.1.0
func (d *DataCenterClient) UpdateUserGlobalPermission(ctx context.Context, userName, permission string) error
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) WithAuthorization ¶ added in v0.1.0
func (d *DataCenterClient) WithAuthorization() uhttp.RequestOption
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 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 User ¶ added in v0.0.5
type User 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"` }