示例#1
0
文件: hsvc.go 项目: 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
}
示例#2
0
文件: svc1.go 项目: andradeandrey/fwk
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
}
示例#3
0
文件: hsvc.go 项目: andradeandrey/fwk
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
}