Skip to content

installers.db.postgresql #

postgresql

To get started




import freeflowuniverse.herolib.installers.something. postgresql

mut installer:= postgresql.get()!

installer.start()!

example heroscript

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

Constants #

const version = '0.0.0'

fn delete #

fn delete(args_ ArgsGet) !

fn exists #

fn exists(args_ ArgsGet) !bool

does the config exists?

fn get #

fn get(args_ ArgsGet) !&Postgresql

fn heroscript_dumps #

fn heroscript_dumps(obj Postgresql) !string

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

fn heroscript_loads #

fn heroscript_loads(heroscript string) !Postgresql

fn play #

fn play(args_ PlayArgs) !

fn set #

fn set(o Postgresql) !

register the config for the future

fn switch #

fn switch(name string)

switch instance to be used for postgresql

struct ArgsGet #

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

///////FACTORY

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
}

struct Postgresql #

@[heap]
struct Postgresql {
pub mut:
	name           string = 'default'
	user           string = 'postgres'
	password       string = 'postgres'
	host           string = 'localhost'
	volume_path    string = '/var/lib/postgresql/data'
	container_name string = 'herocontainer_postgresql'
	port           int    = 5432
	container_id   string
}

fn (Postgresql) destroy #

fn (mut self Postgresql) destroy() !

fn (Postgresql) install #

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

fn (Postgresql) install_start #

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

fn (Postgresql) reload #

fn (mut self Postgresql) reload() !

load from disk and make sure is properly intialized

fn (Postgresql) restart #

fn (mut self Postgresql) restart() !

fn (Postgresql) running #

fn (mut self Postgresql) running() !bool

fn (Postgresql) start #

fn (mut self Postgresql) start() !

fn (Postgresql) stop #

fn (mut self Postgresql) stop() !