Help us shape the future of Go! Take the 2026 Go Developer Survey

client

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BurstLimit        = 10
	RequestsPerSecond = 10
)

Variables

View Source
var (
	ErrClientNotFound = errors.New("client not found in context")
	ErrTokenEmpty     = errors.New("token is empty; please run `concord auth` or set the GITHUB_TOKEN environment variable")
)
View Source
var (
	ErrOrgNotFound  = errors.New("organization not found")
	ErrUserNotFound = errors.New("user not found")
)
View Source
var (
	ErrGetBranch                = errors.New("get branch")
	ErrRepoNotFound             = errors.New("repo not found")
	ErrNoReposFound             = errors.New("no repos found")
	ErrBranchProtectionNotFound = errors.New("branch protection not found")
)

Functions

func WithClient

func WithClient(ctx context.Context, tkn string) (context.Context, error)

Types

type Client

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

func ClientFromContext

func ClientFromContext(ctx context.Context) (*Client, error)

func New

func New(ctx context.Context, tkn string) (*Client, error)

func (*Client) Add

func (c *Client) Add(fn func() error)

func (*Client) AddRepoToTeam

func (c *Client) AddRepoToTeam(ctx context.Context, scrb scribe.Scriber, org, team, repo, perm string) error

func (*Client) Apply

func (c *Client) Apply() error

func (*Client) CreateRepo

func (c *Client) CreateRepo(ctx context.Context, scrb scribe.Scriber, org string, repo *github.Repository)

func (*Client) CreateTeam

func (c *Client) CreateTeam(ctx context.Context, scrb scribe.Scriber, orgName, teamName string)

func (*Client) GetBranchProtection

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

func (*Client) GetBranches

func (c *Client) GetBranches(ctx context.Context, org, repo string) ([]*github.Branch, error)

func (*Client) GetLogins

func (c *Client) GetLogins(ctx context.Context) ([]string, error)

func (*Client) GetMembers

func (c *Client) GetMembers(ctx context.Context, orgName string) ([]*github.User, error)

func (*Client) GetOrg

func (c *Client) GetOrg(ctx context.Context, orgName string) (*github.Organization, error)

func (*Client) GetRepo

func (c *Client) GetRepo(ctx context.Context, org, name string) (*github.Repository, error)

func (*Client) GetRepoTeams

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

func (*Client) GetRepoTopics

func (c *Client) GetRepoTopics(ctx context.Context, org, name string) ([]string, error)

func (*Client) GetRepos

func (c *Client) GetRepos(ctx context.Context, name string) ([]*github.Repository, error)

func (*Client) GetTeamMembers

func (c *Client) GetTeamMembers(ctx context.Context, org, team string) ([]*github.User, error)

func (*Client) GetTeams

func (c *Client) GetTeams(ctx context.Context, orgName string) ([]*github.Team, error)

func (*Client) InitRepo

func (c *Client) InitRepo(ctx context.Context, scrb scribe.Scriber, org, repo, branch string)

func (*Client) InviteMember

func (c *Client) InviteMember(ctx context.Context, scrb scribe.Scriber, orgName string, username string)

func (*Client) InviteTeamMember

func (c *Client) InviteTeamMember(ctx context.Context, scrb scribe.Scriber, org, team, user string)

func (*Client) IsBranchProtected

func (c *Client) IsBranchProtected(ctx context.Context, org, repo, branch string) (bool, error)

func (*Client) OrgExists

func (c *Client) OrgExists(ctx context.Context, orgName string) (bool, error)

func (*Client) ProtectBranch

func (c *Client) ProtectBranch(ctx context.Context, scrb scribe.Scriber, org, repo, branch string, protection *github.ProtectionRequest) error

func (*Client) RemoveRepoFromTeam

func (c *Client) RemoveRepoFromTeam(ctx context.Context, scrb scribe.Scriber, org, team, repo string)

func (*Client) RemoveTeamMember

func (c *Client) RemoveTeamMember(ctx context.Context, orgID, teamID int64, user string) error

func (*Client) RemoveTeamMemberBySlug added in v0.2.0

func (c *Client) RemoveTeamMemberBySlug(ctx context.Context, scrb scribe.Scriber, org, team, user string)

func (*Client) SetOrgPrivileges

func (c *Client) SetOrgPrivileges(ctx context.Context, scrb scribe.Scriber, orgName string, edits *github.Organization) error

func (*Client) SetRepoTopics

func (c *Client) SetRepoTopics(ctx context.Context, scrb scribe.Scriber, org, repo string, topics []string)

func (*Client) SetRequireSignedCommits

func (c *Client) SetRequireSignedCommits(ctx context.Context, scrb scribe.Scriber, org, repo, branch string, require bool) error

func (*Client) UpdateRepo

func (c *Client) UpdateRepo(ctx context.Context, scrb scribe.Scriber, org, repo string, edits *github.Repository)

Jump to

Keyboard shortcuts

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