Example #1
0
File: hsvc.go Project: postfix/fwk
func newhsvc(typ, name string, mgr fwk.App) (fwk.Component, error) {
	var err error
	svc := &hsvc{
		SvcBase: fwk.NewSvc(typ, name, mgr),
		streams: map[string]Stream{},
		w:       map[string]ostream{},
		r:       map[string]istream{},
		h1ds:    make(map[fwk.HID]*h1d),
	}

	err = svc.DeclProp("Streams", &svc.streams)
	if err != nil {
		return nil, err
	}
	return svc, err
}
Example #2
0
func newsvc1(typ, name string, mgr fwk.App) (fwk.Component, error) {
	var err error
	svc := &svc1{
		SvcBase: fwk.NewSvc(typ, name, mgr),
	}

	err = svc.DeclProp("Int", &svc.i)
	if err != nil {
		return nil, err
	}

	err = svc.DeclProp("Struct", &svc.s)
	if err != nil {
		return nil, err
	}

	return svc, err
}
Example #3
0
func newhsvc(typ, name string, mgr fwk.App) (fwk.Component, error) {
	var err error
	svc := &hsvc{
		SvcBase: fwk.NewSvc(typ, name, mgr),
		// input:    "Input",
		// output:   "Output",
		h1ds: make(map[fwk.HID]*h1d),
	}

	// err = svc.DeclProp("Input", &svc.input)
	// if err != nil {
	// 	return nil, err
	// }

	// err = svc.DeclProp("Output", &svc.output)
	// if err != nil {
	//	return nil, err
	// }

	return svc, err
}