github

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: MIT Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*githubv4.Client
	// contains filtered or unexported fields
}

func NewClientWithTokenAuth

func NewClientWithTokenAuth(token string, writer io.Writer) *Client

func (*Client) DownloadContents added in v0.2.0

func (c *Client) DownloadContents(ctx context.Context, owner, repo, filepath string) ([]byte, error)

DownloadContents downloads file contents from the given filepath

func (*Client) FetchOrganizationRepositories added in v0.6.1

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

func (*Client) FetchOrganziationMembers added in v0.4.0

func (c *Client) FetchOrganziationMembers(ctx context.Context, enterprise, organization string) ([]Member, error)

func (*Client) FetchRestRepositories

func (c *Client) FetchRestRepositories(ctx context.Context, owner, repoType string) ([]*github.Repository, error)

type Collaborator added in v0.2.0

type Collaborator struct {
	*graphql.Collaborator
}

type Language added in v0.2.0

type Language struct {
	Name  string `json:"name,omitempty"`
	Color string `json:"color,omitempty"`
	Size  int    `json:"size,omitempty"`
}

type Member added in v0.4.0

type Member struct {
	ID           string        `json:"id,omitempty"`
	Login        string        `json:"login,omitempty"`
	Name         string        `json:"name,omitempty"`
	Email        string        `json:"email,omitempty"`
	Organization string        `json:"organization,omitempty"`
	SamlIdentity *SamlIdentity `json:"saml_identity,omitempty"`
}

func MapIdentitiesToMembers added in v0.4.0

func MapIdentitiesToMembers(identities []graphql.ExternalIdentityNode) []Member

func ReduceMembers added in v0.4.0

func ReduceMembers(members []Member, filter string) ([]Member, error)

ReduceMembers filters the members based on the given filter

type MemberFilterEnv added in v0.4.0

type MemberFilterEnv struct {
	Members []Member
}

MemberFilterEnv filter environment for members

func (MemberFilterEnv) Contains added in v0.4.0

func (MemberFilterEnv) Contains(s, substring string) bool

Contains reports wether substring is in s.

type Repository

type Repository struct {
	ID             string            `json:"id,omitempty"`
	Name           string            `json:"name,omitempty"`
	Description    string            `json:"description,omitempty"`
	URL            string            `json:"url,omitempty"`
	SSHURL         string            `json:"ssh_url,omitempty"`
	Owner          string            `json:"owner,omitempty"`
	Visibility     shared.Visibility `json:"visibility"`
	CreatedAt      time.Time         `json:"created_at,omitempty"`
	UpdatedAt      time.Time         `json:"updated_at,omitempty"`
	PushedAt       time.Time         `json:"pushed_at,omitempty"`
	ForkCount      int               `json:"fork_count,omitempty"`
	StargazerCount int               `json:"stargazer_count,omitempty"`
	WatcherCount   int               `json:"watcher_count,omitempty"`
	Topics         []Topic           `json:"topics,omitempty"`
	Languages      []Language        `json:"languages,omitempty"`
	Collaborators  []Collaborator    `json:"collaborators,omitempty"`
}

func Map

func Map(repositories []graphql.Repository, privateRepositories []*github.Repository) ([]Repository, error)

func ReduceRepositories added in v0.4.0

func ReduceRepositories(repositories []Repository, filter string) ([]Repository, error)

ReduceRepositories filters the repositories based on the given filter

func (Repository) CreatedSince added in v0.2.0

func (r Repository) CreatedSince(date string) bool

CreatedSince indicates if a repository has been created since the given date. Date has to be given in RFC3339 format, e.g. `2006-01-02T15:04:05Z07:00`.

func (Repository) HasLanguage added in v0.2.0

func (r Repository) HasLanguage(language string) bool

HasLanguage indicates if a repository has a given language.

func (Repository) HasTopic added in v0.2.0

func (r Repository) HasTopic(topic string) bool

HasTopic indicates if a repository has a given topic.

func (Repository) IsInternal

func (r Repository) IsInternal() bool

IsInternal indicates if a repository has internal visibility.

func (Repository) IsPrivate

func (r Repository) IsPrivate() bool

IsPrivate indicates if a repository has private visibility.

func (Repository) IsPublic

func (r Repository) IsPublic() bool

IsPublic indicates if a repository has public visibility.

func (Repository) PushedSince added in v0.2.0

func (r Repository) PushedSince(date string) bool

PushedSince indicates if a repository has been pushed since the given date. Date has to be given in RFC3339 format, e.g. `2006-01-02T15:04:05Z07:00`.

func (Repository) UpdatedSince added in v0.2.0

func (r Repository) UpdatedSince(date string) bool

UpdatedSince indicates if a repository has been updated since the given date. Date has to be given in RFC3339 format, e.g. `2006-01-02T15:04:05Z07:00`.

type RepositoryFilterEnv

type RepositoryFilterEnv struct {
	Repositories []Repository
}

RepositoryFilterEnv filter environment for repositories

func (RepositoryFilterEnv) Contains

func (RepositoryFilterEnv) Contains(s, substring string) bool

Contains reports wether substring is in s.

type RestRepo

type RestRepo struct {
	Name string
}

type SamlIdentity added in v0.4.0

type SamlIdentity struct {
	ID string `json:"id,omitempty"`
}

type Topic added in v0.1.2

type Topic struct {
	Name string `json:"name,omitempty"`
	URL  string `json:"url,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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