config

package
v0.0.0-...-552dcf1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextOpts

type ContextOpts struct {
	ConfigPath     string
	EnableColors   bool
	Debug          bool
	Engine         string
	AllowNoContext bool
}

func CreateContextOpts

func CreateContextOpts(cmd *cobra.Command) ContextOpts

CreateContextOpts - creates ContextOpts from flags and environment variables

type GFlowsConfig

type GFlowsConfig struct {
	GithubDir string `yaml:"githubDir"`
	Workflows struct {
		Defaults  GFlowsWorkflowConfig
		Overrides map[string]*GFlowsWorkflowConfig
	}
	Templates struct {
		Engine    string
		Defaults  GFlowsTemplateConfig
		Overrides map[string]*GFlowsTemplateConfig
	}
}

GFlowsConfig - type of current gflows context

func LoadConfig

func LoadConfig(fs *afero.Afero, logger *io.Logger, opts ContextOpts) (config *GFlowsConfig, err error)

LoadConfig - finds and returns the GFlowsConfig

func (*GFlowsConfig) GetAllDependencies

func (config *GFlowsConfig) GetAllDependencies() []string

func (*GFlowsConfig) GetAllLibs

func (config *GFlowsConfig) GetAllLibs() []string

func (*GFlowsConfig) GetTemplateArrayProperty

func (config *GFlowsConfig) GetTemplateArrayProperty(workflowName string, selector func(config *GFlowsTemplateConfig) []string) []string

func (*GFlowsConfig) GetTemplateDeps

func (config *GFlowsConfig) GetTemplateDeps(workflowName string) []string

func (*GFlowsConfig) GetTemplateLibs

func (config *GFlowsConfig) GetTemplateLibs(workflowName string) []string

func (*GFlowsConfig) GetWorkflowBoolProperty

func (config *GFlowsConfig) GetWorkflowBoolProperty(workflowName string, defaultValue bool, selector func(config *GFlowsWorkflowConfig) *bool) bool

func (*GFlowsConfig) GetWorkflowStringProperty

func (config *GFlowsConfig) GetWorkflowStringProperty(workflowName string, selector func(config *GFlowsWorkflowConfig) string) string

type GFlowsContext

type GFlowsContext struct {
	Dir          string
	ConfigPath   string
	GitHubDir    string
	Config       *GFlowsConfig
	EnableColors bool
}

GFlowsContext - current command context

func NewContext

func NewContext(fs *afero.Afero, logger *io.Logger, opts ContextOpts) (*GFlowsContext, error)

func (*GFlowsContext) GetPathInfo

func (context *GFlowsContext) GetPathInfo(localPath string) (*pkg.PathInfo, error)

func (*GFlowsContext) LibsDir

func (context *GFlowsContext) LibsDir() string

func (*GFlowsContext) ResolvePath

func (context *GFlowsContext) ResolvePath(path string) string

ResolvePath - returns paths relative to the working directory (since paths in configs may be written relative to the context directory instead)

func (*GFlowsContext) ResolvePaths

func (context *GFlowsContext) ResolvePaths(paths []string) []string

ResolvePaths - returns an array of resolved paths

func (*GFlowsContext) WorkflowsDir

func (context *GFlowsContext) WorkflowsDir() string

type GFlowsTemplateConfig

type GFlowsTemplateConfig struct {
	Libs         []string
	Dependencies []string
}

type GFlowsWorkflowConfig

type GFlowsWorkflowConfig struct {
	Checks struct {
		Schema struct {
			Enabled *bool
			URI     string `yaml:"uri"`
		}
		Content struct {
			Enabled *bool
		}
	}
}

Jump to

Keyboard shortcuts

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