github

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2020 License: MIT Imports: 14 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) 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"`
	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