Documentation
¶
Index ¶
- func BenchmarkCacheStruct(b *testing.B)
- func Init() (err error)
- type Cache
- type SessionStore
- func (c *SessionStore) Cap() int
- func (c *SessionStore) Close() (err error)
- func (c *SessionStore) Delete(key string) error
- func (c *SessionStore) Get(key string) (any, error)
- func (c *SessionStore) Len() int
- func (c *SessionStore) Reset() error
- func (c *SessionStore) Set(key string, entry any) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BenchmarkCacheStruct ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func New ¶
New creates a globalCache object. mode could be a pointer or not pointer. eg: New(&service{}) or New(service{})
more usage see test case.
type SessionStore ¶
type SessionStore Cache
func NewSessionStore ¶
func NewSessionStore(model any) *SessionStore
NewSessionStore creates a session store that expires automatically.
func (*SessionStore) Cap ¶
func (c *SessionStore) Cap() int
func (*SessionStore) Close ¶
func (c *SessionStore) Close() (err error)
func (*SessionStore) Delete ¶
func (c *SessionStore) Delete(key string) error
func (*SessionStore) Len ¶
func (c *SessionStore) Len() int
func (*SessionStore) Reset ¶
func (c *SessionStore) Reset() error
Click to show internal directories.
Click to hide internal directories.