Go API Documentation

github.com/TykTechnologies/tyk/cli

No package summary is available.

Package

Files: 1. Third party imports: 1. Imports from organisation: 0. Tests: 0. Benchmarks: 0.

Constants

const (
	appName	= "tyk"
	appDesc	= "Tyk Gateway"
)

Vars

var (
	// Conf specifies the configuration file path.
	Conf	*string
	// Port specifies the listen port.
	Port	*string
	// MemProfile enables memory profiling.
	MemProfile	*bool
	// CPUProfile enables CPU profiling.
	CPUProfile	*bool
	// BlockProfile enables block profiling.
	BlockProfile	*bool
	// MutexProfile enables block profiling.
	MutexProfile	*bool
	// HTTPProfile exposes a HTTP endpoint for accessing profiling data.
	HTTPProfile	*bool
	// DebugMode sets the log level to debug mode.
	DebugMode	*bool
	// LogInstrumentation outputs instrumentation data to stdout.
	LogInstrumentation	*bool

	// DefaultMode is set when default command is used.
	DefaultMode	bool

	app	*kingpin.Application

	log	= logger.Get()
)
var initOnce sync.Once

Functions

func Init

Init sets all flags and subcommands. It's only run once to avoid races over the globals. The arguments are ignored for subsequent runs.

func Init(confPaths []string) {
	initOnce.Do(func() {
		setup(confPaths)
	})
}

Cognitive complexity: 1, Cyclomatic complexity: 1

func Parse

Parse parses the command-line arguments.

func Parse() {
	kingpin.MustParse(app.Parse(os.Args[1:]))
}

Cognitive complexity: 0, Cyclomatic complexity: 1

Uses: kingpin.MustParse, os.Args.

Private functions

func setup

setup (confPaths []string)
References: build.Version, bundler.AddTo, fmt.Fprintln, fmt.Printf, fmt.Println, importer.AddTo, ioutil.ReadFile, kingpin.New, kingpin.ParseContext, linter.Run, os.Exit, os.Stderr, plugin.AddTo, version.AddTo.