github

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2020 License: MIT Imports: 14 Imported by: 0

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) FetchOrganziationRepositories

func (c *Client) FetchOrganziationRepositories(ctx context.Context, owner string) ([]Repository, 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 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     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 Reduce

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

Reduce 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 Topic added in v0.1.2

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

type Visibility

type Visibility int

Visibility indicates repository visibility

const (
	// Public repositories are publicly visible
	Public Visibility = iota
	// Internal repositories are only visible to organization members
	Internal
	// Private repositories are only visible to authorized users
	Private
)

func (Visibility) MarshalText added in v0.1.1

func (v Visibility) MarshalText() ([]byte, error)

func (Visibility) String

func (i Visibility) String() string

func (*Visibility) UnmarshalText added in v0.1.1

func (v *Visibility) UnmarshalText(text []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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