admin

package
v0.0.0-...-f2e6f42 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package admin provides GitHub administrative operations for repository and collaborator management.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client wraps the GitHub client for administrative operations

func NewClient

func NewClient(githubClient *github.Client) *Client

NewClient creates a new administrative client

func (*Client) AcceptInvitation

func (c *Client) AcceptInvitation(ctx context.Context, invitationID int64) error

AcceptInvitation accepts a repository invitation

func (*Client) AddCollaborator

func (c *Client) AddCollaborator(ctx context.Context, owner, repo, username, permission string) (*github.CollaboratorInvitation, error)

AddCollaborator invites a user as a collaborator

func (*Client) AddRepositoryTeam

func (c *Client) AddRepositoryTeam(ctx context.Context, owner, repo string, teamID int64, permission string) error

AddRepositoryTeam grants a team access to a repository

func (*Client) ArchiveRepository

func (c *Client) ArchiveRepository(ctx context.Context, owner, repo string) (*github.Repository, error)

ArchiveRepository archives a repository (makes it read-only)

func (*Client) CancelInvitation

func (c *Client) CancelInvitation(ctx context.Context, owner, repo string, invitationID int64) error

CancelInvitation declines or cancels a repository invitation

func (*Client) CheckCollaborator

func (c *Client) CheckCollaborator(ctx context.Context, owner, repo, username string) (bool, error)

CheckCollaborator checks if a user is a collaborator

func (*Client) CreateWebhook

func (c *Client) CreateWebhook(ctx context.Context, owner, repo string, config map[string]interface{}) (*github.Hook, error)

CreateWebhook creates a new repository webhook

func (*Client) DeleteBranchProtection

func (c *Client) DeleteBranchProtection(ctx context.Context, owner, repo, branch string) error

DeleteBranchProtection removes branch protection

func (*Client) DeleteRepository

func (c *Client) DeleteRepository(ctx context.Context, owner, repo string) error

DeleteRepository permanently deletes a repository

func (*Client) DeleteWebhook

func (c *Client) DeleteWebhook(ctx context.Context, owner, repo string, hookID int64) error

DeleteWebhook deletes a repository webhook

func (*Client) GetBranchProtection

func (c *Client) GetBranchProtection(ctx context.Context, owner, repo, branch string) (*github.Protection, error)

GetBranchProtection retrieves branch protection rules

func (*Client) GetRepositorySettings

func (c *Client) GetRepositorySettings(ctx context.Context, owner, repo string) (*github.Repository, error)

GetRepositorySettings retrieves repository configuration

func (*Client) ListCollaborators

func (c *Client) ListCollaborators(ctx context.Context, owner, repo string) ([]*github.User, error)

ListCollaborators lists all repository collaborators

func (*Client) ListInvitations

func (c *Client) ListInvitations(ctx context.Context, owner, repo string) ([]*github.RepositoryInvitation, error)

ListInvitations lists pending repository invitations

func (*Client) ListRepositoryTeams

func (c *Client) ListRepositoryTeams(ctx context.Context, owner, repo string) ([]*github.Team, error)

ListRepositoryTeams lists teams with access to a repository

func (*Client) ListWebhooks

func (c *Client) ListWebhooks(ctx context.Context, owner, repo string) ([]*github.Hook, error)

ListWebhooks lists all repository webhooks

func (*Client) RemoveCollaborator

func (c *Client) RemoveCollaborator(ctx context.Context, owner, repo, username string) error

RemoveCollaborator removes a user's access to a repository

func (*Client) TestWebhook

func (c *Client) TestWebhook(ctx context.Context, owner, repo string, hookID int64) error

TestWebhook triggers a test delivery for a webhook

func (*Client) UpdateBranchProtection

func (c *Client) UpdateBranchProtection(ctx context.Context, owner, repo, branch string, protection *github.ProtectionRequest) (*github.Protection, error)

UpdateBranchProtection configures branch protection rules

func (*Client) UpdateCollaboratorPermission

func (c *Client) UpdateCollaboratorPermission(ctx context.Context, owner, repo, username, permission string) (*github.CollaboratorInvitation, error)

UpdateCollaboratorPermission updates a collaborator's permission level

func (*Client) UpdateRepositorySettings

func (c *Client) UpdateRepositorySettings(ctx context.Context, owner, repo string, settings map[string]interface{}) (*github.Repository, error)

UpdateRepositorySettings modifies repository configuration

func (*Client) UpdateWebhook

func (c *Client) UpdateWebhook(ctx context.Context, owner, repo string, hookID int64, config map[string]interface{}) (*github.Hook, error)

UpdateWebhook modifies an existing webhook

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL