client

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2022 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const EnterpriseOnly = "This organization is not part of externally managed enterprise."

Variables

This section is empty.

Functions

func Configure

func Configure(logger hclog.Logger, config interface{}) (schema.ClientMeta, diag.Diagnostics)

func GithubMockTestHelper

func GithubMockTestHelper(t *testing.T, table *schema.Table, builder func(*testing.T, *gomock.Controller) GithubServices, _ TestOptions)

func IgnoreError

func IgnoreError(err error) bool

func OrgMultiplex

func OrgMultiplex(meta schema.ClientMeta) []schema.ClientMeta

func ResolveOrg

func ResolveOrg(_ context.Context, meta schema.ClientMeta, r *schema.Resource, _ schema.Column) error

Types

type BillingService

type BillingService interface {
	GetStorageBillingOrg(ctx context.Context, org string) (*github.StorageBilling, *github.Response, error)
	GetPackagesBillingOrg(ctx context.Context, org string) (*github.PackageBilling, *github.Response, error)
	GetActionsBillingOrg(ctx context.Context, org string) (*github.ActionBilling, *github.Response, error)
}

type Client

type Client struct {

	// CHANGEME:  Usually you store here your 3rd party clients and use them in the fetcher
	Github GithubServices

	Org string

	Orgs []string
	// contains filtered or unexported fields
}

func (*Client) Logger

func (c *Client) Logger() hclog.Logger

func (Client) WithOrg

func (c Client) WithOrg(org string) schema.ClientMeta

type Config

type Config struct {
	AccessToken string   `yaml:"access_token"`
	Orgs        []string `yaml:"orgs"`
}

func NewConfig

func NewConfig() *Config

func (Config) Example

func (Config) Example() string

type GithubServices

type GithubServices struct {
	Teams         TeamsService
	Billing       BillingService
	Repositories  RepositoriesService
	Organizations OrganizationsService
	Issues        IssuesService
}

type IssuesService

type IssuesService interface {
	ListByOrg(ctx context.Context, org string, opts *github.IssueListOptions) ([]*github.Issue, *github.Response, error)
}

type OrganizationsService

type OrganizationsService interface {
	Get(ctx context.Context, org string) (*github.Organization, *github.Response, error)
	ListInstallations(ctx context.Context, org string, opts *github.ListOptions) (*github.OrganizationInstallations, *github.Response, error)
	ListHooks(ctx context.Context, org string, opts *github.ListOptions) ([]*github.Hook, *github.Response, error)
	ListHookDeliveries(ctx context.Context, org string, id int64, opts *github.ListCursorOptions) ([]*github.HookDelivery, *github.Response, error)
	ListMembers(ctx context.Context, org string, opts *github.ListMembersOptions) ([]*github.User, *github.Response, error)
	GetOrgMembership(ctx context.Context, user, org string) (*github.Membership, *github.Response, error)
}

type RepositoriesService

type RepositoriesService interface {
	ListByOrg(ctx context.Context, org string, opts *github.RepositoryListByOrgOptions) ([]*github.Repository, *github.Response, error)
}

type TeamsService

type TeamsService interface {
	ListTeamReposByID(ctx context.Context, orgID, teamID int64, opts *github.ListOptions) ([]*github.Repository, *github.Response, error)
	ListTeamMembersByID(ctx context.Context, orgID, teamID int64, opts *github.TeamListTeamMembersOptions) ([]*github.User, *github.Response, error)
	ListTeams(ctx context.Context, org string, opts *github.ListOptions) ([]*github.Team, *github.Response, error)
	ListExternalGroups(ctx context.Context, org string, opts *github.ListExternalGroupsOptions) (*github.ExternalGroupList, *github.Response, error)
}

type TestOptions

type TestOptions struct{}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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