Documentation ¶
Index ¶
- Constants
- type GitHubOptions
- func (o *GitHubOptions) AddFlags(fs *flag.FlagSet)
- func (o *GitHubOptions) GitClient(secretAgent *secret.Agent, dryRun bool) (client *git.Client, err error)
- func (o *GitHubOptions) GitHubClient(secretAgent *secret.Agent, dryRun bool) (client github.Client, err error)
- func (o *GitHubOptions) GitHubClientWithAccessToken(token string) github.Client
- func (o *GitHubOptions) GitHubClientWithLogFields(secretAgent *secret.Agent, dryRun bool, fields logrus.Fields) (client github.Client, err error)
- func (o *GitHubOptions) Validate(bool) error
Constants ¶
const DefaultGitHubTokenPath = "/etc/github/oauth" // Exported for testing purposes
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitHubOptions ¶
type GitHubOptions struct { Host string TokenPath string AllowAnonymous bool AllowDirectAccess bool // contains filtered or unexported fields }
GitHubOptions holds options for interacting with GitHub.
Set AllowAnonymous to be true if you want to allow anonymous github access. Set AllowDirectAccess to be true if you want to suppress warnings on direct github access (without ghproxy).
func (*GitHubOptions) AddFlags ¶
func (o *GitHubOptions) AddFlags(fs *flag.FlagSet)
AddFlags injects GitHub options into the given FlagSet.
func (*GitHubOptions) GitClient ¶
func (o *GitHubOptions) GitClient(secretAgent *secret.Agent, dryRun bool) (client *git.Client, err error)
GitClient returns a Git client.
func (*GitHubOptions) GitHubClient ¶
func (o *GitHubOptions) GitHubClient(secretAgent *secret.Agent, dryRun bool) (client github.Client, err error)
GitHubClient returns a GitHub client.
func (*GitHubOptions) GitHubClientWithAccessToken ¶
func (o *GitHubOptions) GitHubClientWithAccessToken(token string) github.Client
GitHubClientWithAccessToken creates a GitHub client from an access token.
func (*GitHubOptions) GitHubClientWithLogFields ¶
func (o *GitHubOptions) GitHubClientWithLogFields(secretAgent *secret.Agent, dryRun bool, fields logrus.Fields) (client github.Client, err error)
GitHubClientWithLogFields returns a GitHub client with extra logging fields
func (*GitHubOptions) Validate ¶
func (o *GitHubOptions) Validate(bool) error
Validate validates GitHub options. Note that validate updates the GitHubOptions to add default valiues for TokenPath and graphqlEndpoint.