Documentation ¶
Overview ¶
Package backup integrates with TRMM to provide backups.
Package backup integrates with TRMM to provide backups.
Package backup integrates with TRMM to provide backups.
Package backup integrates with TRMM to provide backups.
Package backup integrates with TRMM to provide backups.
Index ¶
Constants ¶
View Source
const ( URL = "https://gitlab.com/a8n/backup" AUTHORS = "David Randall" LICENSE = "PostgreSQL" COPYRIGHT = "(c) 2022 The a8n Authors" ORGANIZATION = "Nice Guy IT, LLC" YEAR = "2022" )
Variables ¶
View Source
var ( // NAME is used as the -o target in the build process. NAME = "a8n-backup" // VERSION TODO: Add API version, GUI version, and possibly other versions. VERSION = "unknown version" BUILD_TIME = "unknown time" BUILD_ENV = "unknown env" GIT_COMMIT = "unknown git commit" GIT_TAG = "unknown git tag" GIT_BRANCH = "unknown git branch" )
External variables pulled in during the build process
View Source
var LOG_COLOR = true
Functions ¶
func SetLogging ¶
func SetLogging(l *LoggingConfig)
Types ¶
type Backup ¶
type Backup struct { CLI *CLI Manage *manage.Manage Agent *manage.Agent Crypt *manage.Secrets TRMM *manage.TRMM }
Backup is the backup config
type CLI ¶
type CLI struct { // Manage is the user facing function for managing the backup configs Manage struct { ConfigDir string `kong:"name='data',group='manage',required='',placeholder='/secure/dir',help='Directory of the config files.'"` // FIXME: existingfile or existingdir with a default value will check for the file/dir even if another // command is run. Remove the default value for now. // https://github.com/alecthomas/kong/issues/26 AgentConfig string `` /* 135-byte string literal not displayed */ } `kong:"cmd='',group='manage',help='Manage the backup configuration.'"` // Currently not used TRMM struct { Client string `kong:"name='client',optional,help='TRMM Client'"` Site string `kong:"name='site',optional,help='TRMM Site'"` Agent string `kong:"name='agent',optional,help='TRMM AgentConfig'"` Script string `kong:"name='script',arg='script',help='Script to output.'"` } `kong:"cmd='',group='trmm',help='Tactical RMM functions.'"` // Run will run the backup Agent struct { Backup struct { Paths []string `kong:"arg='',optional='',group='agent',help='restic command'"` } `kong:"cmd='',group='agent',help='Run the backup'"` Restic struct { Command []string `kong:"arg='',group='agent',help='restic command'"` } `kong:"cmd='',group='agent',help='Run a restic command'"` } `kong:"cmd='',group='agent',help='Commands to be run on the agents.'"` // Logging options Logging struct { // https://github.com/rs/zerolog#leveled-logging Level string `kong:"enum='trace,debug,info,warn,error',default='info',help='Log level'"` Type string `kong:"enum='json,console',default='console',help='Log type'"` } `kong:"embed='',prefix='log-'"` // Version Version struct { } `kong:"cmd='',group='version',name='version'"` // License License struct { } `kong:"cmd='',group='license',name='license'"` // FileRepo FileRepo struct { } `kong:"cmd='',group='filerepo',name='filerepo'"` }
CLI contains the command line configuration
func (*CLI) ValidateCLI ¶
ValidateCLI will validate the config (outside Kong) and set sane defaults. Conflicts with "Validate" since it will be called by Kong. See https://github.com/alecthomas/kong#validation Kong checks if the file exists with the type='existingfile' struct tag
type LoggingConfig ¶
type LoggingConfig struct { // https://github.com/rs/zerolog#leveled-logging Level string `enum:"debug,info,warn,error" default:"info"` Type string `enum:"json,console" default:"console"` }
Directories ¶
Path | Synopsis |
---|---|
Package agent is the agent that performs the backup on the computers.
|
Package agent is the agent that performs the backup on the computers. |
cmd
|
|
backup
Package main is the main entry for the 'backup' cli tool.
|
Package main is the main entry for the 'backup' cli tool. |
Package lib contains code and structs shared between the manage and agent modules.
|
Package lib contains code and structs shared between the manage and agent modules. |
crypto
Package crypto contains code and structs shared between the manage and agent modules.
|
Package crypto contains code and structs shared between the manage and agent modules. |
fs
Package fs is a general library of filesystem things.
|
Package fs is a general library of filesystem things. |
pkg
Package pkg deals with downloading and installing packages from git repositories.
|
Package pkg deals with downloading and installing packages from git repositories. |
Package manage provides the management interface for the backup system.
|
Package manage provides the management interface for the backup system. |
Click to show internal directories.
Click to hide internal directories.