db

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArgparseVals

type ArgparseVals struct {
	User       string
	EnvPswdVar string
	NetLoc     string
	Port       uint16
	DBName     string
}

func (*ArgparseVals) GetParser

func (a *ArgparseVals) GetParser(reqArgs RequiredArgs) *argparse.Parser

Returns a parser that can be added to the main application argparse parser as a sub parser. This parser adds the following arguments and populates a ArgparseVals struct.

--dbUser (-u)
--dbEnvPswdVar (-p)
--dbNetLoc
--dbPort
--dbName

type RequiredArgs

type RequiredArgs int

A bit flag that is used to set which arguments are required

const (
	// A flag that will be set to one if the dbUser arg is required.
	UserRequired RequiredArgs = 1 << iota
	// A flag that will be set to one if the dbEnvPswdVar arg is required.
	EnvPswdVarRequired
	// A flag that will be set to one if the dbNetLoc arg is required.
	NetLocRequired
	// A flag that will be set to one if the dbPort arg is required.
	PortRequired
	// A flag that will be set to one if the dbName arg is required.
	DBNameRequired
)

func (RequiredArgs) DBNameRequired

func (o RequiredArgs) DBNameRequired(b bool) RequiredArgs

A flag that will be set to one if the dbName arg is required.

func (RequiredArgs) EnvPswdVarRequired

func (o RequiredArgs) EnvPswdVarRequired(b bool) RequiredArgs

A flag that will be set to one if the dbEnvPswdVar arg is required.

func (RequiredArgs) GetFlag

func (o RequiredArgs) GetFlag(flag RequiredArgs) bool

Returns the supplied flags status

func (RequiredArgs) NetLocRequired

func (o RequiredArgs) NetLocRequired(b bool) RequiredArgs

A flag that will be set to one if the dbNetLoc arg is required.

func (RequiredArgs) PortRequired

func (o RequiredArgs) PortRequired(b bool) RequiredArgs

A flag that will be set to one if the dbPort arg is required.

func (RequiredArgs) UserRequired

func (o RequiredArgs) UserRequired(b bool) RequiredArgs

A flag that will be set to one if the dbUser arg is required.

Jump to

Keyboard shortcuts

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