installers.db.postgresql #
postgresql
To get started
import incubaid.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 list #
fn list(args ArgsList) ![]&Postgresql
if fromdb set: load from filesystem, and not from mem, will also reset what is in mem
fn new #
fn new(args ArgsGet) !&Postgresql
fn play #
fn play(mut plbook PlayBook) !
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 = 'default'
fromdb bool // will load from filesystem
create bool // default will not create if not exist
}
///////FACTORY
struct ArgsList #
@[params]
struct ArgsList {
pub mut:
fromdb bool // will load from filesystem
}
struct InstallArgs #
@[params]
struct InstallArgs {
pub mut:
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 = '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() !