flags

package
v3.2.0-1 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultConfigProvider = "consul.http://localhost:8500"
	DefaultConfigFile     = "configuration.yaml"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Common

type Common interface {
	OverwriteConfig() bool
	UseRegistry() bool
	InDevMode() bool
	ConfigProviderUrl() string
	Profile() string
	ConfigDirectory() string
	ConfigFileName() string
	CommonConfig() string
	Parse([]string)
	RemoteServiceHosts() []string
	Help()
}

Common is an interface that defines AP for the common command-line flags used by most EdgeX services

type Default

type Default struct {
	FlagSet *flag.FlagSet
	// contains filtered or unexported fields
}

Default is the Default implementation of Common used by most EdgeX services

func New

func New() *Default

New returns a Default struct with an empty additional usage string.

func NewWithUsage

func NewWithUsage(additionalUsage string) *Default

NewWithUsage returns a Default struct.

func (*Default) CommonConfig

func (d *Default) CommonConfig() string

CommonConfig returns the location for the common configuration

func (*Default) ConfigDirectory

func (d *Default) ConfigDirectory() string

ConfigDirectory returns the directory where the config file(s) are located, if it was specified.

func (*Default) ConfigFileName

func (d *Default) ConfigFileName() string

ConfigFileName returns the name of the local configuration file

func (*Default) ConfigProviderUrl

func (d *Default) ConfigProviderUrl() string

ConfigProviderUrl returns the url for the Configuration Provider, if one was specified.

func (*Default) Help

func (d *Default) Help()

Help displays the usage help message and exit.

func (*Default) InDevMode

func (d *Default) InDevMode() bool

InDevMode returns whether running in dev mode or not

func (*Default) OverwriteConfig

func (d *Default) OverwriteConfig() bool

OverwriteConfig returns whether the local configuration should be pushed (overwrite) into the Configuration provider

func (*Default) Parse

func (d *Default) Parse(arguments []string)

Parse parses the passed in command-lie arguments looking to the default set of common flags

func (*Default) Profile

func (d *Default) Profile() string

Profile returns the profile name to use, if one was specified

func (*Default) RemoteServiceHosts

func (d *Default) RemoteServiceHosts() []string

func (*Default) UseRegistry

func (d *Default) UseRegistry() bool

UseRegistry returns whether the Registry should be used or not

Jump to

Keyboard shortcuts

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