示例#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
}
示例#2
0
文件: base.go 项目: influx6/proxies
//NewFactory returns a new DirectorFactory
func NewFactory(d *Director) *DirectorFactory {
	return &DirectorFactory{
		Director: d,
		factory:  flux.NewSecureMap(),
	}
}
示例#3
0
文件: formats.go 项目: influx6/goproj
//NewSessionManager allows management of sessions(ambiguous up to you to define that)
func NewSessionManager() *SessionManager {
	return &SessionManager{flux.NewSecureMap()}
}