flagutil

package
v0.0.0-...-1552b08 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GiteeOptions

type GiteeOptions struct {
	TokenPath string
}

GiteeOptions holds options for interacting with Gitee.

func NewGiteeOptions

func NewGiteeOptions() *GiteeOptions

NewGiteeOptions creates a GiteeOptions with default values.

func (*GiteeOptions) AddFlags

func (o *GiteeOptions) AddFlags(fs *flag.FlagSet)

AddFlags injects Gitee options into the given FlagSet.

func (*GiteeOptions) AddFlagsWithoutDefaultGiteeTokenPath

func (o *GiteeOptions) AddFlagsWithoutDefaultGiteeTokenPath(fs *flag.FlagSet)

AddFlagsWithoutDefaultGiteeTokenPath injects Gitee options into the given Flagset without setting a default for for the giteeTokenPath, allowing to use an anonymous Gitee client

func (*GiteeOptions) GitClient

func (o *GiteeOptions) GitClient(secretAgent *secret.Agent, dryRun bool) (git.ClientFactory, error)

GitClient returns a Git client factory.

func (*GiteeOptions) GiteeClient

func (o *GiteeOptions) GiteeClient(secretAgent *secret.Agent, dryRun bool) (client gitee.Client, err error)

GiteeClient returns a Gitee client.

func (*GiteeOptions) GiteeClientWithLogFields

func (o *GiteeOptions) GiteeClientWithLogFields(secretAgent *secret.Agent, dryRun bool, fields logrus.Fields) (gitee.Client, error)

GiteeClientWithLogFields returns a Gitee client with extra logging fields

func (*GiteeOptions) Validate

func (o *GiteeOptions) Validate(dryRun bool) error

Validate validates Gitee options.

Jump to

Keyboard shortcuts

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