Beispiel #1
0
//NewProfile returns a new controlprofile
func NewProfile(containerPath string, tlp *lxc.TemplateOptions, clt *lxc.CloneOptions, d, s time.Duration, snifer bool) (p *ControlProfile) {
	p = &ControlProfile{
		Path:           containerPath,
		Create:         tlp,
		Clone:          clt,
		Snifers:        snifer,
		RetryMax:       10,
		Configurations: flux.NewSecureMap(),
		HookFx:         &HookFx{},
		Hooks:          &api.Hooks{},
		Durations: &Durations{
			Freeze: d,
			Stop:   s,
			Retry:  time.Duration(1) * time.Second,
		},
		Attach: &lxc.AttachOptions{
			ClearEnv: true,
		},
		Checks: &lxc.CheckpointOptions{
			Directory: "",
			Stop:      false,
			Verbose:   true,
		},
		Restores: &lxc.RestoreOptions{
			Directory: "",
			Verbose:   true,
		},
	}
	return
}
Beispiel #2
0
//NewFactory returns a new DirectorFactory
func NewFactory(d *Director) *DirectorFactory {
	return &DirectorFactory{
		Director: d,
		factory:  flux.NewSecureMap(),
	}
}
Beispiel #3
0
//NewSessionManager allows management of sessions(ambiguous up to you to define that)
func NewSessionManager() *SessionManager {
	return &SessionManager{flux.NewSecureMap()}
}