github

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDatasetUnavailable = errors.New("github dataset unavailable")
View Source
var ErrNoEnterpriseSAMLIdentityProvider = errors.New("github enterprise saml identity provider is not configured")
View Source
var ErrNoSAMLIdentityProvider = errors.New("github saml identity provider is not configured")

Functions

This section is empty.

Types

type AppInstallation added in v0.3.0

type AppInstallation struct {
	ID                  int64
	AppID               int64
	AppSlug             string
	AppName             string
	AccountLogin        string
	AccountType         string
	AccountID           int64
	RepositorySelection string
	Permissions         map[string]string
	CreatedAtRaw        string
	UpdatedAtRaw        string
	SuspendedAtRaw      string
	RawJSON             []byte
}

type AuditLogEvent added in v0.3.0

type AuditLogEvent struct {
	DocumentID        string `json:"_document_id"`
	ID                string `json:"id"`
	Action            string `json:"action"`
	Actor             string `json:"actor"`
	User              string `json:"user"`
	CreatedAtRaw      string `json:"@timestamp"`
	Repository        string `json:"repository"`
	Repo              string `json:"repo"`
	RequestID         string `json:"request_id"`
	PATRequestID      string `json:"pat_request_id"`
	PersonalTokenID   string `json:"personal_access_token_id"`
	KeyID             string `json:"key_id"`
	DeployKeyID       string `json:"deploy_key_id"`
	TokenID           string `json:"token_id"`
	Fingerprint       string `json:"fingerprint"`
	OperationType     string `json:"operation_type"`
	ProgrammaticActor string `json:"programmatic_access_type"`
	RawJSON           []byte `json:"-"`
}

type Client

type Client struct {
	BaseURL string
	Token   string
	HTTP    *http.Client
}

func New

func New(baseURL, token string) (*Client, error)

New creates a new GitHub client. It validates that both baseURL and token are provided.

func (*Client) ListEnterpriseSAMLExternalIdentities

func (c *Client) ListEnterpriseSAMLExternalIdentities(ctx context.Context, enterprise string) ([]SAMLExternalIdentity, error)

func (*Client) ListOrgAuditLog added in v0.3.0

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

func (*Client) ListOrgInstallations added in v0.3.0

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

func (*Client) ListOrgMembers

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

func (*Client) ListOrgPersonalAccessTokenRequests added in v0.3.0

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

func (*Client) ListOrgPersonalAccessTokens added in v0.3.0

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

func (*Client) ListOrgRepos added in v0.3.0

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

func (*Client) ListOrgSAMLExternalIdentities

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

func (*Client) ListOrgSCIMUsers

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

func (*Client) ListRepoDeployKeys added in v0.3.0

func (c *Client) ListRepoDeployKeys(ctx context.Context, org, repo string) ([]DeployKey, error)

func (*Client) ListTeamMembers

func (c *Client) ListTeamMembers(ctx context.Context, org, teamSlug string) ([]TeamMember, error)

func (*Client) ListTeamRepos

func (c *Client) ListTeamRepos(ctx context.Context, org, teamSlug string) ([]TeamRepo, error)

func (*Client) ListTeams

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

type Definition

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

func NewDefinition

func NewDefinition(workers int) *Definition

func (*Definition) ConfiguredSubtitle

func (d *Definition) ConfiguredSubtitle(cfg any) string

func (*Definition) DecodeConfig

func (d *Definition) DecodeConfig(raw []byte) (any, error)

func (*Definition) DefaultSubtitle

func (d *Definition) DefaultSubtitle() string

func (*Definition) DisplayName

func (d *Definition) DisplayName() string

func (*Definition) IsConfigured

func (d *Definition) IsConfigured(cfg any) bool

func (*Definition) Kind

func (d *Definition) Kind() string

func (*Definition) MetricsProvider

func (d *Definition) MetricsProvider() registry.MetricsProvider

func (*Definition) NewIntegration

func (d *Definition) NewIntegration(cfg any) (registry.Integration, error)

func (*Definition) Role

func (*Definition) SettingsHref

func (d *Definition) SettingsHref() string

func (*Definition) SourceName

func (d *Definition) SourceName(cfg any) string

func (*Definition) ValidateConfig

func (d *Definition) ValidateConfig(cfg any) error

type DeployKey added in v0.3.0

type DeployKey struct {
	ID            int64
	Key           string
	Title         string
	ReadOnly      bool
	Verified      bool
	AddedBy       string
	CreatedAtRaw  string
	LastUsedAtRaw string
	RawJSON       []byte
}

type GitHubIntegration

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

func NewGitHubIntegration

func NewGitHubIntegration(client *Client, org string, enterprise string, workers int, scimEnabled bool) *GitHubIntegration

func (*GitHubIntegration) InitEvents

func (i *GitHubIntegration) InitEvents() []registry.Event

func (*GitHubIntegration) Kind

func (i *GitHubIntegration) Kind() string

func (*GitHubIntegration) Name

func (i *GitHubIntegration) Name() string

func (*GitHubIntegration) Role

func (*GitHubIntegration) Run

func (i *GitHubIntegration) Run(ctx context.Context, q *gen.Queries, pool *pgxpool.Pool, report func(registry.Event), _ registry.RunMode) error

type Member

type Member struct {
	Login       string
	ID          int64
	Role        string
	AccountType string
	Email       string
	DisplayName string
	RawJSON     []byte
}

type PersonalAccessToken added in v0.3.0

type PersonalAccessToken struct {
	ID                  int64
	Name                string
	Status              string
	OwnerLogin          string
	OwnerID             int64
	RepositorySelection string
	Permissions         map[string]string
	CreatedAtRaw        string
	UpdatedAtRaw        string
	LastUsedAtRaw       string
	ExpiresAtRaw        string
	Expired             bool
	Revoked             bool
	ReviewerLogin       string
	ReviewerID          int64
	ReviewedAtRaw       string
	RawJSON             []byte
}

type PersonalAccessTokenRequest added in v0.3.0

type PersonalAccessTokenRequest struct {
	ID                  int64
	TokenID             int64
	TokenName           string
	Status              string
	OwnerLogin          string
	OwnerID             int64
	RepositorySelection string
	Permissions         map[string]string
	CreatedAtRaw        string
	UpdatedAtRaw        string
	LastUsedAtRaw       string
	ExpiresAtRaw        string
	ReviewerLogin       string
	ReviewerID          int64
	ReviewedAtRaw       string
	RawJSON             []byte
}

type Repository added in v0.3.0

type Repository struct {
	ID            int64
	Name          string
	FullName      string
	Private       bool
	Archived      bool
	Disabled      bool
	DefaultBranch string
	CreatedAtRaw  string
	UpdatedAtRaw  string
	PushedAtRaw   string
	RawJSON       []byte
}

type SAMLExternalIdentity

type SAMLExternalIdentity struct {
	Login  string
	NameID string
	// SCIMUserName is the SCIM identity username (often the SCIM userName).
	SCIMUserName string
	// SCIMEmail is the first SCIM identity email value (when present).
	SCIMEmail string
	// UserEmail is the GitHub user email from the GraphQL user.email field.
	UserEmail string
}

type SCIMEmail

type SCIMEmail struct {
	Value   string `json:"value"`
	Primary bool   `json:"primary"`
}

type SCIMUser

type SCIMUser struct {
	ID          string
	UserName    string
	DisplayName string
	Active      bool
	Emails      []SCIMEmail

	// GitHubLogin may be populated from GitHub SCIM extensions when available.
	GitHubLogin string

	RawJSON []byte
}

func (SCIMUser) PreferredEmail

func (u SCIMUser) PreferredEmail() string

type Team

type Team struct {
	ID   int64
	Name string
	Slug string
}

type TeamMember

type TeamMember struct {
	Login string
	ID    int64
}

type TeamRepo

type TeamRepo struct {
	FullName   string
	Permission string
	RawJSON    []byte
}

Jump to

Keyboard shortcuts

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