Documentation
¶
Index ¶
- Variables
- func Join(names ...string) string
- type Creator
- type Data
- func (d *Data) CreateAt() time.Time
- func (d *Data) ExpireAt() *time.Time
- func (d *Data) Extend() *Data
- func (d *Data) Fetch() (bool, error)
- func (d *Data) FetchData() (interface{}, error)
- func (d *Data) Get() (interface{}, error)
- func (d *Data) IsExist() bool
- func (d *Data) IsExpired() bool
- func (d *Data) String() string
- func (d *Data) Update() error
- func (d *Data) UpdateAt() time.Time
- func (d *Data) UpdateData() (interface{}, error)
- type Service
- func (s *Service) Bucket(key string, value interface{}, limit int, expireAt string) error
- func (s *Service) Fetch(key string, updater Updater, expireAt string) (bool, error)
- func (s *Service) FetchAll() error
- func (s *Service) Get(key string) *Data
- func (s *Service) Has(key string) bool
- func (s *Service) Increase(key string)
- func (s *Service) IncreaseN(key string, increase int)
- func (s *Service) Set(key string, value interface{}, expireAt string) error
- func (s *Service) SetData(data *Data) error
- func (s *Service) SetFn(key string, creator Creator, expireAt string) error
- func (s *Service) Size() int
- func (s *Service) String() string
- func (s *Service) Update(key string, value interface{}, expireAt string)
- func (s *Service) UpdateFn(key string, updater Updater, expireAt string) error
- type Updater
Constants ¶
This section is empty.
Variables ¶
View Source
var Global = New(logger.DefaultManager.New("caches", "global"))
View Source
var Persistent string = ""
Functions ¶
Types ¶
type Data ¶
type Data struct { Key string `json:"-"` Data interface{} Error error `json:",omitempty"` // contains filtered or unexported fields }
func (*Data) Fetch ¶
Fetch will update only if data is missing or expired return true if data got updated
func (*Data) UpdateData ¶
UpdateData same with Update but return data out
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) Increase ¶
Increase is shorted method for increase number everytime it's called by 1
Click to show internal directories.
Click to hide internal directories.