config

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseFlags

func ParseFlags() (string, error)

func ValidateConfigPath

func ValidateConfigPath(path string) error

ValidateConfigPath just makes sure, that the path provided is a file, that can be read

Types

type Config

type Config struct {
	NetboxUrl            string                `yaml:"netbox_url"`
	NetboxToken          string                `yaml:"netbox_token"`
	RootPath             string                `yaml:"root_path"`
	NameOverwrites       []ConfigNameOverwrite `yaml:"name_overwrites"`
	SessionPath          ConfigSessionPath     `yaml:"session_path"`
	EnablePeriodicSync   bool                  `yaml:"periodic_sync_enable"`
	PeriodicSyncInterval *int                  `yaml:"periodic_sync_interval"`
	DefaultCredential    *string               `yaml:"default_credential"`
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(configPath string) (*Config, error)

func (*Config) Save

func (c *Config) Save() error

type ConfigNameOverwrite

type ConfigNameOverwrite struct {
	Regex string `yaml:"regex"`
	Value string `yaml:"value"`
}

type ConfigSessionPath

type ConfigSessionPath struct {
	Template   string                    `yaml:"template"`
	Overwrites []ConfigTemplateOverwrite `yaml:"overwrites"`
}

type ConfigTemplateOverwrite

type ConfigTemplateOverwrite struct {
	Key      string `yaml:"key"`
	Value    string `yaml:"value"`
	Template string `yaml:"template"`
}

Jump to

Keyboard shortcuts

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