func (o *ServerOption) init() { defval.String(&o.ListenAddr, ":4000") defval.Int(&o.PathVarCount, 3) defval.Int(&o.FilterCount, 5) if o.KeepAlivePeriod == 0 { o.KeepAlivePeriod = 3 * time.Minute // same as net/http/server.go:tcpKeepAliveListener } if o.Logger == nil { o.Logger = log2.Default() } }
func NewListPool(bufsize int, allowsmall bool) Pool { p := &ListPool{ bufsize: bufsize, allowSmall: allowsmall, } defval.Int(&p.bufsize, DEF_BUFSIZE) return p }
func NewSyncPool(bufsize int, allowsmall bool) Pool { p := &SyncPool{ bufsize: bufsize, allowSmall: allowsmall, } defval.Int(&p.bufsize, DEF_BUFSIZE) p.pool.New = func() interface{} { return make([]byte, p.bufsize) } return p }
func (r *Recovery) Init(env zerver.Environment) error { r.logger = env.Logger().Prefix("[Recovery]") defval.Int(&r.Bufsize, 1024*4) return nil }