github

package
v0.2.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2020 License: MIT Imports: 12 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) *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 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"`
}

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

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