commands

package
v3.31.6 Latest Latest
Warning

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

Go to latest
Published: May 10, 2023 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDomains

func CreateDomains(args CreateDomainsArgs) error

CreateDomains contains all data/flags needed to run create-domains, independently of CLI.

func ExecuteDSL

func ExecuteDSL(args ExecuteDSLArgs) (*models.DNSConfig, error)

ExecuteDSL executes the dnsconfig.js contents.

func FmtFile added in v3.8.0

func FmtFile(args FmtArgs) error

FmtFile reads and formats a file.

func GetCerts

func GetCerts(args GetCertsArgs) error

GetCerts implements the get-certs command.

func GetDNSConfig

func GetDNSConfig(args GetDNSConfigArgs) (*models.DNSConfig, error)

GetDNSConfig reads the json-formatted IR file. Or executes javascript. All depending on flags provided.

func GetZone

func GetZone(args GetZoneArgs) error

GetZone contains all data/flags needed to run get-zones, independently of CLI.

func InitializeProviders

func InitializeProviders(cfg *models.DNSConfig, providerConfigs map[string]map[string]string, notifyFlag bool) (notify notifications.Notifier, err error)

InitializeProviders takes (fully processed) configuration and instantiates all providers and returns them.

func Preview

func Preview(args PreviewArgs) error

Preview implements the preview subcommand.

func PrintIR

func PrintIR(args PrintIRArgs) error

PrintIR implements the print-ir subcommand.

func PrintJSON

func PrintJSON(args PrintJSONArgs, config *models.DNSConfig) (err error)

PrintJSON outputs/prettyprints the IR data.

func PrintValidationErrors

func PrintValidationErrors(errs []error) (fatal bool)

PrintValidationErrors formats and prints the validation errors and warnings.

func Push

func Push(args PushArgs) error

Push implements the push subcommand.

func Run

func Run(v string) int

Run will execute the CLI

func WriteTypes added in v3.24.0

func WriteTypes(args TypesArgs) error

WriteTypes creates the types file.

Types

type CheckArgs added in v3.21.0

type CheckArgs struct {
	GetDNSConfigArgs
}

CheckArgs encapsulates the flags/arguments for the check command.

type CreateDomainsArgs

type CreateDomainsArgs struct {
	GetDNSConfigArgs
	GetCredentialsArgs
}

CreateDomainsArgs args required for the create-domain subcommand.

type ExecuteDSLArgs

type ExecuteDSLArgs struct {
	JSFile   string
	JSONFile string
	DevMode  bool
	Variable cli.StringSlice
}

ExecuteDSLArgs are used anytime we need to read and execute dnscontrol DSL

type FilterArgs

type FilterArgs struct {
	Providers string
	Domains   string
}

FilterArgs encapsulates the flags/args for sub-commands that can filter by provider or domain.

type FmtArgs added in v3.8.0

type FmtArgs struct {
	InputFile  string
	OutputFile string
}

FmtArgs stores arguments related to the fmt subcommand.

type GetCertsArgs

type GetCertsArgs struct {
	GetDNSConfigArgs
	GetCredentialsArgs

	ACMEServer     string
	CertsFile      string
	RenewUnderDays int
	CertDirectory  string
	Email          string
	AgreeTOS       bool
	Verbose        bool
	Vault          bool
	VaultPath      string
	Only           string

	Notify bool

	IgnoredProviders string
}

GetCertsArgs stores the flags and arguments common to cert commands

type GetCredentialsArgs

type GetCredentialsArgs struct {
	CredsFile string
}

GetCredentialsArgs encapsulates the flags/args for sub-commands that use the creds.json file.

type GetDNSConfigArgs

type GetDNSConfigArgs struct {
	ExecuteDSLArgs
	JSONFile string
}

GetDNSConfigArgs contains what we need to get a valid dns config. Could come from parsing js, or from stored json

type GetZoneArgs

type GetZoneArgs struct {
	GetCredentialsArgs          // Args related to creds.json
	CredName           string   // key in creds.json
	ProviderName       string   // provider type: BIND, GANDI_V5, etc or "-"  (NB(tlim): In 4.0, this field goes away.)
	ZoneNames          []string // The zones to get
	OutputFormat       string   // Output format
	OutputFile         string   // Filename to send output ("" means stdout)
	DefaultTTL         int      // default TTL for providers where it is unknown
}

GetZoneArgs args required for the create-domain subcommand.

type PreviewArgs

type PreviewArgs struct {
	GetDNSConfigArgs
	GetCredentialsArgs
	FilterArgs
	Notify      bool
	WarnChanges bool
	NoPopulate  bool
	Full        bool
}

PreviewArgs contains all data/flags needed to run preview, independently of CLI

type PrintIRArgs

type PrintIRArgs struct {
	GetDNSConfigArgs
	PrintJSONArgs
	Raw bool
}

PrintIRArgs encapsulates the flags/arguments for the print-ir command.

type PrintJSONArgs

type PrintJSONArgs struct {
	Pretty bool
	Output string
}

PrintJSONArgs are used anytime a command may print some json

type PushArgs

type PushArgs struct {
	PreviewArgs
	Interactive bool
}

PushArgs contains all data/flags needed to run push, independently of CLI

type TypesArgs added in v3.24.0

type TypesArgs struct {
	DTSFile string
}

TypesArgs stores arguments related to the types subcommand.

Jump to

Keyboard shortcuts

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