Documentation
¶
Index ¶
- Constants
- func WithConfluenceRatelimitData(resource *v2.RateLimitDescription) uhttp.DoOption
- type AddUserToGroupRequestBody
- type ConfluenceClient
- func (c *ConfluenceClient) AddSpacePermission(ctx context.Context, spaceName string, key string, target string, ...) (*v2.RateLimitDescription, error)
- func (c *ConfluenceClient) AddUserToGroup(ctx context.Context, accountID string, groupId string) (*v2.RateLimitDescription, error)
- func (c *ConfluenceClient) ConfluenceSpaceOperations(ctx context.Context, cursor string, pageSize int, spaceId string) ([]ConfluenceSpaceOperation, string, *v2.RateLimitDescription, error)
- func (c *ConfluenceClient) GetGroupMembers(ctx context.Context, pageToken string, pageSize int, groupId string) ([]ConfluenceUser, string, *v2.RateLimitDescription, error)
- func (c *ConfluenceClient) GetGroups(ctx context.Context, pageToken string, pageSize int) ([]ConfluenceGroup, string, *v2.RateLimitDescription, error)
- func (c *ConfluenceClient) GetSpacePermissions(ctx context.Context, pageToken string, pageSize int, spaceId string) ([]ConfluenceSpacePermission, string, *v2.RateLimitDescription, error)
- func (c *ConfluenceClient) GetSpaces(ctx context.Context, pageSize int, paginationCursor string) ([]ConfluenceSpace, string, *v2.RateLimitDescription, error)
- func (c *ConfluenceClient) GetUsersFromSearch(ctx context.Context, pageToken string, pageSize int) ([]ConfluenceUser, string, *v2.RateLimitDescription, error)
- func (c *ConfluenceClient) RemoveSpacePermission(ctx context.Context, spaceId string, key string, target string, ...) (*v2.RateLimitDescription, error)
- func (c *ConfluenceClient) RemoveUserFromGroup(ctx context.Context, accountID string, groupId string) (*v2.RateLimitDescription, error)
- func (c *ConfluenceClient) Verify(ctx context.Context) error
- type ConfluenceGroup
- type ConfluenceLink
- type ConfluenceMeta
- type ConfluenceOperation
- type ConfluenceSearch
- type ConfluenceSearchList
- type ConfluenceSpace
- type ConfluenceSpaceDescription
- type ConfluenceSpaceDescriptionValue
- type ConfluenceSpaceOperation
- type ConfluenceSpaceOperationsResponse
- type ConfluenceSpacePermission
- type ConfluenceSpacePermissionOperation
- type ConfluenceSpacePermissionPrincipal
- type ConfluenceSpacePermissionResponse
- type ConfluenceUser
- type CreateSpacePermissionRequestBody
- type Option
- type RequestError
- type SpacePermissionOperation
- type SpacePermissionSubject
Constants ¶
View Source
const ( CurrentUserUrlPath = "/wiki/rest/api/user/current" GroupsListUrlPath = "/wiki/rest/api/group" SearchUrlPath = "/wiki/rest/api/search/user" SpacesListUrlPath = "/wiki/api/v2/spaces" SpacePermissionsListUrlPath = "/wiki/api/v2/spaces/%s/permissions" )
Variables ¶
This section is empty.
Functions ¶
func WithConfluenceRatelimitData ¶
func WithConfluenceRatelimitData(resource *v2.RateLimitDescription) uhttp.DoOption
WithConfluenceRatelimitData Per the docs: transient 5XX errors should be treated as 429/too-many-requests if they have a retry header. 503 errors were the only ones explicitly called out, but I guess it's possible for others too https://developer.atlassian.com/cloud/confluence/rate-limiting/
Types ¶
type AddUserToGroupRequestBody ¶
type AddUserToGroupRequestBody struct {
AccountId string `json:"accountId"`
}
type ConfluenceClient ¶
type ConfluenceClient struct {
// contains filtered or unexported fields
}
func NewConfluenceClient ¶
func NewConfluenceClient(ctx context.Context, user, apiKey, domain string) (*ConfluenceClient, error)
func (*ConfluenceClient) AddSpacePermission ¶
func (*ConfluenceClient) AddUserToGroup ¶
func (c *ConfluenceClient) AddUserToGroup( ctx context.Context, accountID string, groupId string, ) (*v2.RateLimitDescription, error)
func (*ConfluenceClient) ConfluenceSpaceOperations ¶
func (c *ConfluenceClient) ConfluenceSpaceOperations( ctx context.Context, cursor string, pageSize int, spaceId string, ) ( []ConfluenceSpaceOperation, string, *v2.RateLimitDescription, error, )
func (*ConfluenceClient) GetGroupMembers ¶
func (c *ConfluenceClient) GetGroupMembers( ctx context.Context, pageToken string, pageSize int, groupId string, ) ( []ConfluenceUser, string, *v2.RateLimitDescription, error, )
func (*ConfluenceClient) GetGroups ¶
func (c *ConfluenceClient) GetGroups( ctx context.Context, pageToken string, pageSize int, ) ( []ConfluenceGroup, string, *v2.RateLimitDescription, error, )
func (*ConfluenceClient) GetSpacePermissions ¶
func (c *ConfluenceClient) GetSpacePermissions( ctx context.Context, pageToken string, pageSize int, spaceId string, ) ( []ConfluenceSpacePermission, string, *v2.RateLimitDescription, error, )
func (*ConfluenceClient) GetSpaces ¶
func (c *ConfluenceClient) GetSpaces( ctx context.Context, pageSize int, paginationCursor string, ) ( []ConfluenceSpace, string, *v2.RateLimitDescription, error, )
GetSpaces uses pagination to get a list of spaces from the global list.
func (*ConfluenceClient) GetUsersFromSearch ¶
func (c *ConfluenceClient) GetUsersFromSearch( ctx context.Context, pageToken string, pageSize int, ) ( []ConfluenceUser, string, *v2.RateLimitDescription, error, )
GetUsersFromSearch There are no official, documented ways to get lists of users in Confluence. One way to get users is to issue a CQL search query with no conditions. The documentation mentions that queries return "up to 10k" users. So that may end up being a limitation of this approach.
func (*ConfluenceClient) RemoveSpacePermission ¶
func (*ConfluenceClient) RemoveUserFromGroup ¶
func (c *ConfluenceClient) RemoveUserFromGroup( ctx context.Context, accountID string, groupId string, ) (*v2.RateLimitDescription, error)
type ConfluenceGroup ¶
type ConfluenceLink ¶
type ConfluenceMeta ¶
type ConfluenceOperation ¶
type ConfluenceSearch ¶
type ConfluenceSearch struct {
EntityType string `json:"entityType"`
Score float64 `json:"score"`
Title string `json:"title"`
User ConfluenceUser `json:"user"`
}
type ConfluenceSearchList ¶
type ConfluenceSearchList struct {
Start int `json:"start"`
Limit int `json:"limit"`
TotalSize int `json:"totalSize"`
Size int `json:"size"`
Results []ConfluenceSearch `json:"results"`
}
type ConfluenceSpace ¶
type ConfluenceSpace struct {
AuthorId string `json:"authorId"`
CreatedAt string `json:"createdAt"`
Description ConfluenceSpaceDescription `json:"description"`
HomepageId string `json:"homepageId"`
Icon string `json:"icon"`
Id string `json:"id"`
Key string `json:"key"`
Name string `json:"name"`
Operations ConfluenceSpaceOperationsResponse `json:"operations"`
Status string `json:"status"`
Type string `json:"type"`
}
type ConfluenceSpaceDescription ¶
type ConfluenceSpaceDescription struct {
Plain ConfluenceSpaceDescriptionValue `json:"plain"`
}
type ConfluenceSpaceOperationsResponse ¶
type ConfluenceSpaceOperationsResponse struct {
Links ConfluenceLink `json:"_links"`
Meta ConfluenceMeta `json:"meta"`
Results []ConfluenceSpaceOperation `json:"results"`
}
type ConfluenceSpacePermission ¶
type ConfluenceSpacePermission struct {
Id string `json:"id"`
Principal ConfluenceSpacePermissionPrincipal `json:"principal"`
Operation ConfluenceSpacePermissionOperation `json:"operation"`
}
type ConfluenceSpacePermissionResponse ¶
type ConfluenceSpacePermissionResponse struct {
Links ConfluenceLink `json:"_links"`
Results []ConfluenceSpacePermission `json:"results"`
}
type ConfluenceUser ¶
type ConfluenceUser struct {
AccountId string `json:"accountId"`
AccountType string `json:"accountType"`
DisplayName string `json:"displayName"`
Email string `json:"email,omitempty"`
Operations []ConfluenceOperation `json:"operations,omitempty"`
}
type CreateSpacePermissionRequestBody ¶
type CreateSpacePermissionRequestBody struct {
Subject SpacePermissionSubject `json:"subject"`
Operation SpacePermissionOperation `json:"operation"`
}
type RequestError ¶
func (*RequestError) Error ¶
func (r *RequestError) Error() string
type SpacePermissionSubject ¶
Click to show internal directories.
Click to hide internal directories.