Skip to content

installers.infra.dify #

dify

dify

To get started



import freeflowuniverse.herolib.installers.something.dify as dify_installer

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

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

dify_installer.play(heroscript=heroscript)!

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

example heroscript

!!dify.configure
    homedir: '/home/user/dify'
    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) !&DifyInstaller

fn heroscript_dumps #

fn heroscript_dumps(obj DifyInstaller) !string

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

fn heroscript_loads #

fn heroscript_loads(heroscript string) !DifyInstaller

fn play #

fn play(args_ PlayArgs) !

fn set #

fn set(o DifyInstaller) !

register the config for the future

fn switch #

fn switch(name string)

switch instance to be used for dify

struct ArgsGet #

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

///////FACTORY

struct DefaultConfigArgs #

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

helpers

struct DifyInstaller #

@[heap]
struct DifyInstaller {
pub mut:
	name          string = 'default'
	path          string = '/opt/dify'
	init_password string
	secret_key    string
	project_name  string = 'dify'
	compose_file  string = '/opt/dify/docker/docker-compose.yaml'
}

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

fn (DifyInstaller) build #

fn (mut self DifyInstaller) build() !

fn (DifyInstaller) destroy #

fn (mut self DifyInstaller) destroy() !

fn (DifyInstaller) install #

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

fn (DifyInstaller) install_start #

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

fn (DifyInstaller) reload #

fn (mut self DifyInstaller) reload() !

load from disk and make sure is properly intialized

fn (DifyInstaller) restart #

fn (mut self DifyInstaller) restart() !

fn (DifyInstaller) running #

fn (mut self DifyInstaller) running() !bool

fn (DifyInstaller) start #

fn (mut self DifyInstaller) start() !

fn (DifyInstaller) stop #

fn (mut self DifyInstaller) stop() !

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
}