cli

package
v0.0.0-...-ad9271d Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TokenEnvKey is the default GitHub token environemt variable key
	TokenEnvKey = "GITHUB_TOKEN"
	// GitHubURL Prefix for github URLs
	GitHubURL = "https://github.com/"
)

Variables

This section is empty.

Functions

func Execute

func Execute()

func GetRepos

func GetRepos(ctx context.Context) ([]*github.Repository, error)

func GetRepositoryActivityScore

func GetRepositoryActivityScore(repo *Repo) int

GetRepositoryActivityScore (From https://patterns.innersourcecommons.org/p/repository-activity-score) Calculate a virtual InnerSource score from stars, watches, commits, and issues.

func NewClient

func NewClient() *github.Client

New creates a new default GitHub client. Tokens set via the $GITHUB_TOKEN environment variable will result in an authenticated client. If the $GITHUB_TOKEN is not set, then the client will do unauthenticated GitHub requests.

func NewClientWithToken

func NewClientWithToken(token string) (*github.Client, error)

NewClientWithToken can be used to specify a GitHub token through parameters. Empty string will result in unauthenticated client, which makes unauthenticated requests.

func NewEnterpriseClient

func NewEnterpriseClient(baseURL, uploadURL string) (*github.Client, error)

func NewEnterpriseClientWithToken

func NewEnterpriseClientWithToken(baseURL, uploadURL, token string) (*github.Client, error)

Types

type InnerSourceMetadata

type InnerSourceMetadata struct {
	Title         string
	Motivation    string
	Contributions []string
	Skills        []string
	Docs          string
	Language      string

	// TODO: These fields are not documented but potentially in use
	Participation string
	Guidelines    string
	Score         int
}

type Options

type Options struct {
	User          string
	Organizations []string
	Topics        []string
	Visibility    string
}

type Repo

type Repo struct {
	GH       *github.Repository
	Metadata *InnerSourceMetadata
}

Jump to

Keyboard shortcuts

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