Documentation ¶
Index ¶
- Variables
- func IsRobotUsername(name string) bool
- type APIError
- type Client
- func (c *Client) AddUserToTeam(ctx context.Context, org string, team string, member string) error
- func (c *Client) ChangeRepositoryVisibility(ctx context.Context, repo string, visibility RepositoryVisibility) error
- func (c *Client) CreateOrganizationRobot(ctx context.Context, org string, shortName string, ...) error
- func (c *Client) CreateRepository(ctx context.Context, opt CreateRepositoryOptions) error
- func (c *Client) DeleteOrganizationRobot(ctx context.Context, org string, shortName string) error
- func (c *Client) DeleteRepository(ctx context.Context, repo string) error
- func (c *Client) DeleteTeam(ctx context.Context, org string, team string) error
- func (c *Client) GetOrganization(ctx context.Context, name string) (*Organization, error)
- func (c *Client) GetOrganizationMembers(ctx context.Context, organization string) ([]OrganizationMember, error)
- func (c *Client) GetOrganizationRobot(ctx context.Context, org string, shortName string) (*Robot, error)
- func (c *Client) GetOrganizationRobots(ctx context.Context, org string, options GetOrganizationRobotsOptions) ([]Robot, error)
- func (c *Client) GetRepositories(ctx context.Context, options GetRepositoriesOptions) ([]Repository, error)
- func (c *Client) GetRepositoryTeamPermissions(ctx context.Context, repo string) (map[string]Permission, error)
- func (c *Client) GetRepositoryUserPermissions(ctx context.Context, repo string) (map[string]Permission, error)
- func (c *Client) GetTeamMembers(ctx context.Context, org string, team string, opt GetTeamMembersOptions) ([]TeamMember, error)
- func (c *Client) GetUser(ctx context.Context, username string) (*User, error)
- func (c *Client) RemoveTeamFromRepository(ctx context.Context, repo string, team string) error
- func (c *Client) RemoveUserFromRepository(ctx context.Context, repo string, user string) error
- func (c *Client) RemoveUserFromTeam(ctx context.Context, org string, team string, member string) error
- func (c *Client) SetTeamRepositoryPermissions(ctx context.Context, repo string, team string, role RepositoryRole) error
- func (c *Client) SetUserRepositoryPermissions(ctx context.Context, repo string, user string, role RepositoryRole) error
- func (c *Client) UpdateRepository(ctx context.Context, repo string, opt UpdateRepositoryOptions) error
- func (c *Client) UpsertTeam(ctx context.Context, org string, team string, opt UpsertTeamOptions) error
- type CreateOrganizationRobotOptions
- type CreateRepositoryOptions
- type GetOrganizationRobotsOptions
- type GetRepositoriesOptions
- type GetTeamMembersOptions
- type Organization
- type OrganizationMember
- type Permission
- type RepoByName
- type Repository
- type RepositoryKind
- type RepositoryRole
- type RepositoryVisibility
- type Robot
- type RobotByName
- type Team
- type TeamMember
- type TeamMembershipKind
- type TeamRole
- type UpdateRepositoryOptions
- type UpsertTeamOptions
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var AllRepositoryRoles = []RepositoryRole{ReadRepositoryRole, WriteRepositoryRole, AdminRepositoryRole}
View Source
var AllTeamRoles = []TeamRole{MemberTeamRole, CreatorTeamRole, AdminTeamRole}
Functions ¶
func IsRobotUsername ¶ added in v0.3.0
Types ¶
type APIError ¶
type APIError struct { Status int `json:"status"` ErrorMessage string `json:"error_message"` Title string `json:"title"` ErrorType string `json:"error_type"` Detail string `json:"detail"` Type string `json:"type"` // Message is only set in some error conditions, like when adding // a user to a team they are already a member of. This is not documented, // but reality nontheless. Message string `json:"message"` }
type Client ¶
func (*Client) AddUserToTeam ¶
func (*Client) ChangeRepositoryVisibility ¶ added in v0.2.0
func (*Client) CreateOrganizationRobot ¶ added in v0.1.1
func (*Client) CreateRepository ¶ added in v0.2.0
func (c *Client) CreateRepository(ctx context.Context, opt CreateRepositoryOptions) error
func (*Client) DeleteOrganizationRobot ¶
func (*Client) DeleteRepository ¶ added in v0.2.0
func (*Client) DeleteTeam ¶
func (*Client) GetOrganization ¶
func (*Client) GetOrganizationMembers ¶
func (*Client) GetOrganizationRobot ¶ added in v0.4.0
func (*Client) GetOrganizationRobots ¶
func (*Client) GetRepositories ¶
func (c *Client) GetRepositories(ctx context.Context, options GetRepositoriesOptions) ([]Repository, error)
func (*Client) GetRepositoryTeamPermissions ¶
func (*Client) GetRepositoryUserPermissions ¶
func (*Client) GetTeamMembers ¶
func (c *Client) GetTeamMembers(ctx context.Context, org string, team string, opt GetTeamMembersOptions) ([]TeamMember, error)
func (*Client) RemoveTeamFromRepository ¶
func (*Client) RemoveUserFromRepository ¶
func (*Client) RemoveUserFromTeam ¶
func (*Client) SetTeamRepositoryPermissions ¶
func (*Client) SetUserRepositoryPermissions ¶
func (*Client) UpdateRepository ¶ added in v0.2.0
func (*Client) UpsertTeam ¶
type CreateOrganizationRobotOptions ¶ added in v0.1.1
type CreateOrganizationRobotOptions struct {
Description string `json:"description"`
}
type CreateRepositoryOptions ¶ added in v0.2.0
type CreateRepositoryOptions struct { Kind RepositoryKind `json:"kind"` Namespace string `json:"namespace"` Repository string `json:"repository"` Visibility RepositoryVisibility `json:"visibility"` Description string `json:"description"` }
type GetRepositoriesOptions ¶
type GetTeamMembersOptions ¶
type GetTeamMembersOptions struct {
IncludePending *bool
}
type Organization ¶
type Organization struct { Name string `json:"name"` Email string `json:"email"` InvoiceEmail bool `json:"invoice_email"` InvoiceEmailAddress string `json:"invoice_email_address"` IsMember bool `json:"is_member"` IsFreeAccount bool `json:"is_free_account"` IsAdmin bool `json:"is_admin"` Teams map[string]Team `json:"teams"` OrderedTeams []string `json:"ordered_teams"` }
type OrganizationMember ¶
type Permission ¶
type Permission struct { Role RepositoryRole `json:"role"` Name string `json:"name"` // these are only set for user permissions IsOrgMember bool `json:"is_org_member"` IsRobot bool `json:"is_robot"` }
type RepoByName ¶
type RepoByName []Repository
func (RepoByName) Len ¶
func (a RepoByName) Len() int
func (RepoByName) Less ¶
func (a RepoByName) Less(i, j int) bool
func (RepoByName) Swap ¶
func (a RepoByName) Swap(i, j int)
type Repository ¶
type Repository struct { Kind string `json:"kind"` Name string `json:"name"` Namespace string `json:"namespace"` State interface{} `json:"state"` IsPublic bool `json:"is_public"` IsStarred bool `json:"is_starred"` Description string `json:"description"` }
func (*Repository) FullName ¶
func (r *Repository) FullName() string
func (*Repository) Visibility ¶ added in v0.2.1
func (r *Repository) Visibility() RepositoryVisibility
type RepositoryKind ¶ added in v0.2.0
type RepositoryKind string
const ( ImageRepository RepositoryKind = "image" ApplicationRepository RepositoryKind = "application" )
type RepositoryRole ¶
type RepositoryRole string
const ( // Can view and pull from the repository ReadRepositoryRole RepositoryRole = "read" // Can view, pull and push to the repository WriteRepositoryRole RepositoryRole = "write" // Full admin access, pull and push on the repository AdminRepositoryRole RepositoryRole = "admin" )
type RepositoryVisibility ¶ added in v0.2.0
type RepositoryVisibility string
const ( Public RepositoryVisibility = "public" Private RepositoryVisibility = "private" )
type Robot ¶
type Robot struct { Name string `json:"name"` Description string `json:"description"` Token string `json:"token"` // Repositories is only set if the permissions option is set // when fetching robots. Repositories []string `json:"repositories"` // Teams is only set if the permissions option is set // when fetching robots. Teams []struct { Name string `json:"name"` } `json:"teams"` }
type RobotByName ¶
type RobotByName []Robot
func (RobotByName) Len ¶
func (a RobotByName) Len() int
func (RobotByName) Less ¶
func (a RobotByName) Less(i, j int) bool
func (RobotByName) Swap ¶
func (a RobotByName) Swap(i, j int)
type TeamMember ¶
type TeamMember struct { Kind TeamMembershipKind `json:"kind"` Name string `json:"name"` Invited bool `json:"invited"` IsRobot bool `json:"is_robot"` }
type TeamMembershipKind ¶
type TeamMembershipKind string
const ( TeamMemberUser TeamMembershipKind = "user" TeamMemberRobot TeamMembershipKind = "robot" // maybe? )
type UpdateRepositoryOptions ¶ added in v0.2.0
type UpdateRepositoryOptions struct {
Description string `json:"description"`
}
type UpsertTeamOptions ¶
Click to show internal directories.
Click to hide internal directories.