| | |
| | | package bhomedbapi |
| | | |
| | | import ( |
| | | "basic.com/valib/bhomebus.git" |
| | | "basic.com/valib/c_bhomebus.git/proto/source/bhome_msg" |
| | | "errors" |
| | | "fmt" |
| | | "strconv" |
| | |
| | | } |
| | | } |
| | | |
| | | var getNetNode = func(topic string) []bhomebus.NetNode{ |
| | | var getNetNode = func(topic string) []*bhome_msg.MsgQueryTopicReply_BHNodeAddress{ |
| | | return nil |
| | | } |
| | | |
| | | func InitGetNetNode(fn func(name string)[]bhomebus.NetNode) { |
| | | if fn != nil { |
| | | getNetNode = fn |
| | | } |
| | | func InitGetNetNode(fn func(name string)[]*bhome_msg.MsgQueryTopicReply_BHNodeAddress) { |
| | | //if fn != nil { |
| | | // getNetNode = fn |
| | | //} |
| | | } |
| | | |
| | | var busReq = func(req []byte,nodes []bhomebus.NetNode) ([]byte, error) { |
| | | var busReq = func(req *bhome_msg.MsgRequestTopic,dest []*bhome_msg.MsgQueryTopicReply_BHNodeAddress) ([]byte, error) { |
| | | return nil, errors.New("please init InitDoReq first") |
| | | } |
| | | |
| | | func InitDoReq(fn func([]byte, []bhomebus.NetNode) ([]byte, error)) { |
| | | func InitDoReq(fn func(*bhome_msg.MsgRequestTopic, []*bhome_msg.MsgQueryTopicReply_BHNodeAddress) ([]byte, error)) { |
| | | if fn != nil { |
| | | busReq = fn |
| | | } |