Beispiel #1
0
func RegisterHooks(r *hook.Registry) {
	var hw helloWorld
	hw.svc.Register(r.Clone("httpservice"), "", "webserver", hw.handler)
	r.RegisterHook("*", hw.start)
}
Beispiel #2
0
func RegisterHooks(r *hook.Registry) {
	c := Charm{}
	r.RegisterContext(c.setContext, nil)
	r.RegisterHook("start", c.start)
	r.RegisterHook("upgrade-charm", c.start)
	r.RegisterHook("config-changed", c.configChanged)
	c.svc.Register(r.Clone("service"), "", c.startService)

	r.RegisterConfig("user", charm.Option{
		Type:        "string",
		Description: "Provide Steam user name",
		Default:     "",
	})
}