mirror of
https://github.com/gofiber/fiber.git
synced 2025-05-02 05:34:25 +00:00
* Bind support for Render. * update * fix tests * split Pass-locals-to-views & Bind from Render * update comments. * add benchs. * Update ctx.go Co-authored-by: hi019 <65871571+hi019@users.noreply.github.com> * Update ctx.go * optimize * switch dictpool. * ✨ feature: bind support for render - improve performance * ✨ feature: bind support for render - improve performance Co-authored-by: hi019 <65871571+hi019@users.noreply.github.com> Co-authored-by: wernerr <rene.werner@verivox.com> Co-authored-by: wernerr <rene@gofiber.io>
26 lines
545 B
Go
26 lines
545 B
Go
package dictpool
|
|
|
|
//go:generate msgp
|
|
|
|
// KV struct so it storages key/value data.
|
|
type KV struct {
|
|
Key string
|
|
Value interface{}
|
|
}
|
|
|
|
// Dict dictionary as slice with better performance.
|
|
type Dict struct {
|
|
// D slice of KV for storage the data
|
|
D []KV
|
|
|
|
// Use binary search to the get an item.
|
|
// It's only useful on big heaps.
|
|
//
|
|
// WARNING: Increase searching performance on big heaps,
|
|
// but whe set new items could be slowier due to the sorting.
|
|
BinarySearch bool
|
|
}
|
|
|
|
// DictMap dictionary as map.
|
|
type DictMap map[string]interface{}
|