configuration

package
v0.0.0-...-bf9f4d5 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package configuration is where all program's input flags are specified. It is also where their validation happens.

Usage

Instantiate a new GlifParameters object at the beginning and use it like so:

GO CODE -------------------------------------------------- glifParam := GlifParameters{}

if ok := glifParam.Parse(); !ok {
	panic("failed to properly parse input flags")
}

// Program can run using valide input flags ------------------------------------------------------------ The Parse() method will call the flag.String(), flag.Bool(), etc... to set all necessary values Finally a call to the methode validate() is made and it's where application-related validation happen.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GlifFlags

type GlifFlags struct {
	REPL       *bool
	ForceFetch *bool
}

GlifFlags contains the various boolean flags (actual command line flags and not parameters) used by glif.

type GlifParameters

type GlifParameters struct {
	Script  *string
	Tickets *string

	Flags   GlifFlags
	Scripts GlifPreConfiguredScripts

	UserSpecifiedScript string
}

GlifParameters contains the various flags that were given via the program's input paramters It also contains an instance of GlifFlags and GlifPreConfiguredScripts

  • see: configuration.GlifFlags
  • see: configuration.GlifPreConfiguredScripts

func (*GlifParameters) Parse

func (params *GlifParameters) Parse(forceRepl bool) bool

Parse encapsulate the function calls to the Go flag package. It also internally runs an application-related validation.

type GlifPreConfiguredScripts

type GlifPreConfiguredScripts struct {
	UseDiffLatestSemverWithLatestBuilds *bool
	UseDiffLatestSemverWithLatestRCs    *bool
	UseDiffLatestSemver                 *bool
	UseDiffLatestSemverToHead           *bool
	UseUserSpecifiedScript              *bool
}

GlifPreConfiguredScripts contains only boolean flags that specify if a "preconfigured" script should be used.

  • see script package

Jump to

Keyboard shortcuts

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