Skip to content

installers.sysadmintools.b2 #

b2

To get started



import freeflowuniverse.herolib.installers.something.b2 as b2_installer

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

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

b2_installer.play(heroscript=heroscript)!

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

example heroscript

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

Constants #

const version = '4.3.0'

fn get #

fn get(args_ ArgsGet) !&BackBase

fn heroscript_dumps #

fn heroscript_dumps(obj BackBase) !string

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

fn heroscript_loads #

fn heroscript_loads(heroscript string) !BackBase

fn play #

fn play(args_ PlayArgs) !

fn switch #

fn switch(name string)

switch instance to be used for b2

struct ArgsGet #

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

///////FACTORY

struct BackBase #

@[heap]
struct BackBase {
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 (BackBase) destroy #

fn (mut self BackBase) destroy() !

fn (BackBase) install #

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

struct DefaultConfigArgs #

@[params]
struct DefaultConfigArgs {
	instance string = 'default'
}

helpers

struct InstallArgs #

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

struct PlayArgs #

@[params]
struct PlayArgs {
pub mut:
	heroscript string // if filled in then plbook will be made out of it
	plbook     ?playbook.PlayBook
	reset      bool
}