package bhomeclient import "fmt" type Config struct { regKey int //注册的shmKey shmSize int //共享内存块的大小,默认是512M chSize int //reply或sub chan的size sendTimeOut int //millisecond recvTimeOut int //millisecond pubTimeOut int //millisecond fnLog func(...interface{}) } func DefaultConfig() *Config { return &Config{ regKey: 12, shmSize: 512, chSize: 5, sendTimeOut: 100, recvTimeOut: 10, pubTimeOut: 100, fnLog: func(v ...interface{}) { fmt.Println(v...) }, } } func NewConfig(regKey_ int,shmSize_ int, chSize_ int, sendTimeOut_ int, recvTimeOut_ int, pubTimeOut_ int, logFn func(...interface{})) *Config { return &Config{ regKey: regKey_, shmSize: shmSize_, chSize: chSize_, sendTimeOut: sendTimeOut_, recvTimeOut: recvTimeOut_, pubTimeOut: pubTimeOut_, fnLog:logFn, } }