2017-11-23 05:37:08 +00:00
|
|
|
package common
|
|
|
|
|
2018-06-17 07:28:18 +00:00
|
|
|
// NullTopicCache is a topic cache to be used when you don't want a cache and just want queries to passthrough to the database
|
2017-11-23 05:37:08 +00:00
|
|
|
type NullTopicCache struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewNullTopicCache gives you a new instance of NullTopicCache
|
|
|
|
func NewNullTopicCache() *NullTopicCache {
|
|
|
|
return &NullTopicCache{}
|
|
|
|
}
|
|
|
|
|
2018-06-17 07:28:18 +00:00
|
|
|
// nolint
|
2019-02-23 06:29:19 +00:00
|
|
|
func (c *NullTopicCache) Get(id int) (*Topic, error) {
|
2017-11-23 05:37:08 +00:00
|
|
|
return nil, ErrNoRows
|
|
|
|
}
|
2019-02-23 06:29:19 +00:00
|
|
|
func (c *NullTopicCache) GetUnsafe(id int) (*Topic, error) {
|
2017-11-23 05:37:08 +00:00
|
|
|
return nil, ErrNoRows
|
|
|
|
}
|
2019-02-23 06:29:19 +00:00
|
|
|
func (c *NullTopicCache) BulkGet(ids []int) (list []*Topic) {
|
|
|
|
return make([]*Topic, len(ids))
|
|
|
|
}
|
|
|
|
func (c *NullTopicCache) Set(_ *Topic) error {
|
2017-11-23 05:37:08 +00:00
|
|
|
return nil
|
|
|
|
}
|
2019-02-23 06:29:19 +00:00
|
|
|
func (c *NullTopicCache) Add(_ *Topic) error {
|
2017-11-23 05:37:08 +00:00
|
|
|
return nil
|
|
|
|
}
|
2019-02-23 06:29:19 +00:00
|
|
|
func (c *NullTopicCache) AddUnsafe(_ *Topic) error {
|
2017-11-23 05:37:08 +00:00
|
|
|
return nil
|
|
|
|
}
|
2019-02-23 06:29:19 +00:00
|
|
|
func (c *NullTopicCache) Remove(id int) error {
|
2017-11-23 05:37:08 +00:00
|
|
|
return nil
|
|
|
|
}
|
2019-02-23 06:29:19 +00:00
|
|
|
func (c *NullTopicCache) RemoveUnsafe(id int) error {
|
2017-11-23 05:37:08 +00:00
|
|
|
return nil
|
|
|
|
}
|
2019-02-23 06:29:19 +00:00
|
|
|
func (c *NullTopicCache) Flush() {
|
2017-11-23 05:37:08 +00:00
|
|
|
}
|
2019-02-23 06:29:19 +00:00
|
|
|
func (c *NullTopicCache) Length() int {
|
2017-11-23 05:37:08 +00:00
|
|
|
return 0
|
|
|
|
}
|
2019-02-23 06:29:19 +00:00
|
|
|
func (c *NullTopicCache) SetCapacity(_ int) {
|
2017-11-23 05:37:08 +00:00
|
|
|
}
|
2019-02-23 06:29:19 +00:00
|
|
|
func (c *NullTopicCache) GetCapacity() int {
|
2017-11-23 05:37:08 +00:00
|
|
|
return 0
|
|
|
|
}
|