options

package
v0.0.1-rc3.0...-dbcd76a Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(flagSet *pflag.FlagSet) error

func InitYAML

func InitYAML() error

Types

type Alias

type Alias struct {
	Type AliasType `mapstructure:"type"`
	Name string    `mapstructure:"name"`

	// Literal
	Flags map[string][]string `mapstructure:"flags,omitempty"`

	// FilePattern
	Paths    []string `mapstructure:"paths,omitempty"`
	Patterns []string `mapstructure:"patterns,omitempty"`

	// Command
	Command *string `mapstructure:"command,omitempty"`
	Timeout *int64  `mapstructure:"timeout,omitempty"`
}

Alias is a catch-all type for alias configurations

func (*Alias) IsValid

func (a *Alias) IsValid() error

type AliasType

type AliasType string
const (
	Literal AliasType = "literal"

	CamelCase      AliasType = "camelcase"
	PascalCase     AliasType = "pascalcase"
	SnakeCase      AliasType = "snakecase"
	UpperSnakeCase AliasType = "uppersnakecase"
	KebabCase      AliasType = "kebabcase"
	DotCase        AliasType = "dotcase"

	FilePattern AliasType = "filepattern"

	Command AliasType = "command"
)

func (AliasType) Canonical

func (a AliasType) Canonical() AliasType

func (AliasType) IsValid

func (a AliasType) IsValid() error

func (AliasType) String

func (a AliasType) String() string

type Delimiters

type Delimiters struct {
	// If set to `true`, the default delimiters (single-quote, double-qoute, and backtick) will not be used unless provided as `additional` delimiters
	DisableDefaults bool     `mapstructure:"disableDefaults"`
	Additional      []string `mapstructure:"additional"`
}

type Options

type Options struct {
	AccessToken         string `mapstructure:"accessToken"`
	BaseUri             string `mapstructure:"baseUri"`
	Branch              string `mapstructure:"branch"`
	CommitUrlTemplate   string `mapstructure:"commitUrlTemplate"`
	DefaultBranch       string `mapstructure:"defaultBranch"`
	Dir                 string `mapstructure:"dir" yaml:"-"`
	HunkUrlTemplate     string `mapstructure:"hunkUrlTemplate"`
	OutDir              string `mapstructure:"outDir"`
	ProjKey             string `mapstructure:"projkey"`
	RepoName            string `mapstructure:"repoName"`
	RepoType            string `mapstructure:"repoType"`
	RepoUrl             string `mapstructure:"repoUrl"`
	Revision            string `mapstructure:"revision"`
	ContextLines        int    `mapstructure:"contextLines"`
	Lookback            int    `mapstructure:"lookback"`
	UpdateSequenceId    int    `mapstructure:"updateSequenceId"`
	Debug               bool   `mapstructure:"debug"`
	DryRun              bool   `mapstructure:"dryRun"`
	IgnoreServiceErrors bool   `mapstructure:"ignoreServiceErrors"`

	Aliases    []Alias    `mapstructure:"aliases"`
	Delimiters Delimiters `mapstructure:"delimiters"`
}

func GetOptions

func GetOptions() (Options, error)

func GetWrapperOptions

func GetWrapperOptions(dir string, merge func(Options) (Options, error)) (Options, error)

func (Options) Validate

func (o Options) Validate() error

Validate ensures all options have been set to a valid value

func (Options) ValidateRequired

func (o Options) ValidateRequired() error

Jump to

Keyboard shortcuts

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