Documentation
¶
Index ¶
- type Client
- func (c *Client) Create(ctx context.Context, organization string, teamID uuid.UUID, ...) error
- func (c *Client) Delete(ctx context.Context, organization string, teamID uuid.UUID, ...) error
- func (c *Client) List(ctx context.Context, organization string, teamID uuid.UUID) (*ListPermissionsResponse, error)
- type CreatePermission
- type ListPermissionsResponse
- type Permission
- type PermissionIdentifier
- type PermissionType
- type RepositoryPermission
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
*up.Config
}
Client is a repositories permission client.
func NewClient ¶
func NewClient(cfg *up.Config) *Client
NewClient build a repositories permission client from the passed config.
func (*Client) Create ¶
func (c *Client) Create(ctx context.Context, organization string, teamID uuid.UUID, params CreatePermission) error
Create assigns a specified permission to a team for a repository on Upbound.
type CreatePermission ¶
type CreatePermission struct { Permission RepositoryPermission `json:"permission"` Repository string `json:"repository"` }
CreatePermission holds the parameters for creating a repository permission.
type ListPermissionsResponse ¶
type ListPermissionsResponse struct { Permissions []Permission `json:"permissions"` Size int `json:"size"` Page int `json:"page"` Count int `json:"count"` }
ListPermissionsResponse represents the response from listing repository permissions.
type Permission ¶
type Permission struct { TeamID uuid.UUID `json:"teamId"` RepositoryID int `json:"repositoryId"` AccountID int `json:"accountId"` Privilege PermissionType `json:"privilege"` CreatorID int `json:"creatorId"` CreatedAt time.Time `json:"createdAt"` UpdatedAt *time.Time `json:"updatedAt,omitempty"` RepositoryName string `json:"repositoryName"` }
Permission represents a repository permission entry.
type PermissionIdentifier ¶
type PermissionIdentifier struct {
Repository string `json:"repository"`
}
PermissionIdentifier holds the parameters for a repository permission.
type PermissionType ¶
type PermissionType string
PermissionType represents the type of permission for a repository.
const ( PermissionAdmin PermissionType = "admin" PermissionRead PermissionType = "read" PermissionWrite PermissionType = "write" PermissionView PermissionType = "view" )
PermissionTypes
type RepositoryPermission ¶
type RepositoryPermission struct {
Permission PermissionType `json:"permission"`
}
RepositoryPermission represents the permission to be set for a repository.