Skip to content

installers.sysadmintools.restic #

restic

To get started



import incubaid.herolib.installers.something.restic as restic_installer

heroscript:='
!!restic.configure name:'test'
    password: '1234'
    port: 7701

!!restic.start name:'test' reset:1 
'

restic_installer.play(heroscript=heroscript)!

//or we can call the default and do a start with reset
//mut installer:= restic_installer.get()!
//installer.start(reset:true)!

example heroscript

!!restic.configure
    homedir: '/home/user/restic'
    username: 'admin'
    password: 'secretpassword'
    title: 'Some Title'
    host: 'localhost'
    port: 8888

Constants #

const version = '0.0.0'

fn build #

fn build(args BuildArgs) !

install restic will return true if it was already installed

fn get #

fn get(args ArgsGet) !&Restic

fn heroscript_dumps #

fn heroscript_dumps(obj Restic) !string

///////////NORMALLY NO NEED TO TOUCH

fn heroscript_loads #

fn heroscript_loads(heroscript string) !Restic

fn install #

fn install(args_ InstallArgs) !

fn new #

fn new(args ArgsGet) !&Restic

fn play #

fn play(mut plbook PlayBook) !

fn switch #

fn switch(name string)

switch instance to be used for restic

struct ArgsGet #

@[params]
struct ArgsGet {
pub mut:
	name string = 'default'
}

///////FACTORY

struct BuildArgs #

@[params]
struct BuildArgs {
pub mut:
	reset    bool
	bin_push bool = true
}

struct InstallArgs #

@[params]
struct InstallArgs {
pub mut:
	reset bool
}

struct Restic #

@[heap]
struct Restic {
pub mut:
	name string = 'default'
}

THIS THE THE SOURCE OF THE INFORMATION OF THIS FILE, HERE WE HAVE THE CONFIG OBJECT CONFIGURED AND MODELLED

fn (Restic) build #

fn (mut self Restic) build() !

fn (Restic) destroy #

fn (mut self Restic) destroy() !

fn (Restic) install #

fn (mut self Restic) install(args InstallArgs) !

fn (Restic) install_start #

fn (mut self Restic) install_start(args InstallArgs) !

fn (Restic) restart #

fn (mut self Restic) restart() !

fn (Restic) running #

fn (mut self Restic) running() !bool

fn (Restic) start #

fn (mut self Restic) start() !

fn (Restic) stop #

fn (mut self Restic) stop() !