Golang NewSystemdManager Examples

Golang NewSystemdManager - 2 examples found. These are the top rated real world Golang examples of github.com/coreos/fleet/systemd.NewSystemdManager extracted from open source projects. You can rate examples to help us improve the quality of examples.
Example #1
0
func New(registry *registry.Registry, events *event.EventBus, machine *machine.Machine, ttl, unitPrefix string, verifier *sign.SignatureVerifier) (*Agent, error) {
	ttldur, err := time.ParseDuration(ttl)
	if err != nil {
		return nil, err
	}

	state := NewState()
	mgr := systemd.NewSystemdManager(machine, unitPrefix)

	return &Agent{registry, events, machine, ttldur, unitPrefix, verifier, state, mgr, nil}, nil
}
Example #2
0
func New(reg registry.Registry, eStream *registry.EventStream, mach *machine.Machine, ttl string, verifier *sign.SignatureVerifier) (*Agent, error) {
	ttldur, err := time.ParseDuration(ttl)
	if err != nil {
		return nil, err
	}

	mgr, err := systemd.NewSystemdManager(mach)
	if err != nil {
		return nil, err
	}

	state := NewState()
	eBus := event.NewEventBus()

	a := &Agent{reg, eStream, eBus, mach, ttldur, verifier, state, mgr, nil}

	hdlr := NewEventHandler(a)
	eBus.AddListener("agent", hdlr)

	return a, nil
}