mongodbflag

package
v0.2.15 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

View Source
const (
	EnvUsername = "PCAS_MONGO_USERNAME"
	EnvPassword = "PCAS_MONGO_PASSWORD"
	EnvHost     = "PCAS_MONGO_HOST"
)

The environment variables consulted

Variables

This section is empty.

Functions

This section is empty.

Types

type Set

type Set struct {
	// contains filtered or unexported fields
}

Set represents a set of command-line flags defined by a client config.

func NewSet

func NewSet(c *mongodb.ClientConfig) *Set

NewSet returns a set of command-line flags with defaults given by c. If c is nil then the mongodb.DefaultConfig() will be used. Note that this does not update the default client config, nor does this update c. To recover the updated client config after parse, call the ClientConfig() method on the returned set.

func (*Set) ClientConfig

func (s *Set) ClientConfig() *mongodb.ClientConfig

ClientConfig returns the client config described by this set. This should only be called after the set has been successfully validated.

func (*Set) Flags

func (s *Set) Flags() []flag.Flag

Flags returns the members of the set.

func (*Set) Name

func (*Set) Name() string

Name returns the name of this collection of flags.

func (*Set) SetDefault

func (s *Set) SetDefault(name string)

SetDefault sets the default client config as described by this set. The given app name. This should only be called after the set has been successfully validated.

func (*Set) UsageFooter

func (*Set) UsageFooter() string

UsageFooter returns the footer for the usage message for this flag set.

func (*Set) UsageHeader

func (*Set) UsageHeader() string

UsageHeader returns the header for the usage message for this flag set.

func (*Set) Validate

func (s *Set) Validate() error

Validate validates the flag set.

Jump to

Keyboard shortcuts

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