Documentation ¶
Overview ¶
The pool subpackage is the new hashmap cache pool, which is only for testing now.
It will replace the Context cache pool in the future.
Index ¶
- Variables
- type MessageSession
- type Pool
- func (p *Pool) Append(k, v string) bool
- func (p *Pool) Del(k string) bool
- func (p *Pool) Get(k string) (string, bool)
- func (p *Pool) Insert(k, v string) bool
- func (p *Pool) Len() int
- func (p *Pool) Range(f func(k string, v string) bool)
- func (p *Pool) ResetPool()
- func (p *Pool) Set(k, v string) bool
- func (p *Pool) UseCompress(compress compress.Interface) error
- type Session
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDisableSwitchCmp = errors.New("disable switching of compression algorithm in a pool that has completed compression initialization") )
Functions ¶
This section is empty.
Types ¶
type MessageSession ¶
type MessageSession struct { ID string // Session ID Messages data.MessageArray RawData []byte // Unprocessed raw json data returned by the API endpoint Response resp.Response ErrorResp *resp.ErrorResponse }
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
func (*Pool) Append ¶
Append will take out the data, and then append a new piece of data to the end before saving it.
func (*Pool) Insert ¶
Insert sets the value under the specified key to the map if it does not exist yet. If a resizing operation is happening concurrently while calling Insert, the item might show up in the map after the resize operation is finished. Returns true if the item was inserted or false if it existed.
func (*Pool) Range ¶
Range calls f sequentially for each key and value present in the map. If f returns false, range stops the iteration.
Click to show internal directories.
Click to hide internal directories.