2019-05-17 08:40:41 +00:00
|
|
|
package common
|
|
|
|
|
|
|
|
// NullReplyCache is a reply cache to be used when you don't want a cache and just want queries to passthrough to the database
|
|
|
|
type NullReplyCache struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewNullReplyCache gives you a new instance of NullReplyCache
|
|
|
|
func NewNullReplyCache() *NullReplyCache {
|
2022-02-21 03:32:53 +00:00
|
|
|
return &NullReplyCache{}
|
2019-05-17 08:40:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// nolint
|
|
|
|
func (c *NullReplyCache) Get(id int) (*Reply, error) {
|
2022-02-21 03:32:53 +00:00
|
|
|
return nil, ErrNoRows
|
2019-05-17 08:40:41 +00:00
|
|
|
}
|
|
|
|
func (c *NullReplyCache) GetUnsafe(id int) (*Reply, error) {
|
2022-02-21 03:32:53 +00:00
|
|
|
return nil, ErrNoRows
|
2019-05-17 08:40:41 +00:00
|
|
|
}
|
|
|
|
func (c *NullReplyCache) BulkGet(ids []int) (list []*Reply) {
|
2022-02-21 03:32:53 +00:00
|
|
|
return make([]*Reply, len(ids))
|
2019-05-17 08:40:41 +00:00
|
|
|
}
|
|
|
|
func (c *NullReplyCache) Set(_ *Reply) error {
|
2022-02-21 03:32:53 +00:00
|
|
|
return nil
|
2019-05-17 08:40:41 +00:00
|
|
|
}
|
|
|
|
func (c *NullReplyCache) Add(_ *Reply) error {
|
2022-02-21 03:32:53 +00:00
|
|
|
return nil
|
2019-05-17 08:40:41 +00:00
|
|
|
}
|
|
|
|
func (c *NullReplyCache) AddUnsafe(_ *Reply) error {
|
2022-02-21 03:32:53 +00:00
|
|
|
return nil
|
2019-05-17 08:40:41 +00:00
|
|
|
}
|
|
|
|
func (c *NullReplyCache) Remove(id int) error {
|
2022-02-21 03:32:53 +00:00
|
|
|
return nil
|
2019-05-17 08:40:41 +00:00
|
|
|
}
|
|
|
|
func (c *NullReplyCache) RemoveUnsafe(id int) error {
|
2022-02-21 03:32:53 +00:00
|
|
|
return nil
|
2019-05-17 08:40:41 +00:00
|
|
|
}
|
|
|
|
func (c *NullReplyCache) Flush() {
|
|
|
|
}
|
|
|
|
func (c *NullReplyCache) Length() int {
|
2022-02-21 03:32:53 +00:00
|
|
|
return 0
|
2019-05-17 08:40:41 +00:00
|
|
|
}
|
|
|
|
func (c *NullReplyCache) SetCapacity(_ int) {
|
|
|
|
}
|
|
|
|
func (c *NullReplyCache) GetCapacity() int {
|
2022-02-21 03:32:53 +00:00
|
|
|
return 0
|
2019-05-17 08:40:41 +00:00
|
|
|
}
|