func newContext(mapper typemapper.TypeMapper, wrappers []*wrapper) *context { ret := &context{ TypeMapper: typemapper.New(mapper), wrappers: wrappers, funcIndex: 0, } ret.InsertType(ret, contextType) return ret }
// Clone creates another Middleware which has same content. func (m *Middleware) Clone() *Middleware { wrappers := make([]*wrapper, len(m.wrappers)) for i, wrapper := range m.wrappers { wrappers[i] = wrapper } return &Middleware{ TypeMapper: typemapper.New(m.TypeMapper), wrappers: wrappers, } }
// New creates a new Middleware func New() *Middleware { return &Middleware{ TypeMapper: typemapper.New(nil), } }
func newFakeContext() *fakeContext { return &fakeContext{ TypeMapper: typemapper.New(nil), } }