gosora/common/null_topic_cache.go
Azareal 6870d242e9 Add ClearIPs() to TopicStore.
Add LockMany() to TopicStore.
Add RemoveMany() to TopicCache.
Add ClearIPs() to PollStore.
Add Purge() to RegLogStore.
Add DeleteOlderThanDays() to RegLogStore.
Add Purge() to LoginLogStore.
Add DeleteOlderThanDays() to LoginLogStore.
Add SetInt() to MetaStore.
Add SetInt64() to MetaStore.

Use Createf() in RegLogItem.Create()
Use Count() in SQLRegLogStore.Count()
Use Count() in SQLLoginLogStore.Count()
Use Countf() in SQLLoginLogStore.CountUser()

Add trailing triple dot parser test case.
Removed a block of commented code in gen router.
Reduce boilerplate.
2021-04-27 20:20:26 +10:00

50 lines
1.1 KiB
Go

package common
// NullTopicCache is a topic cache to be used when you don't want a cache and just want queries to passthrough to the database
type NullTopicCache struct {
}
// NewNullTopicCache gives you a new instance of NullTopicCache
func NewNullTopicCache() *NullTopicCache {
return &NullTopicCache{}
}
// nolint
func (c *NullTopicCache) Get(id int) (*Topic, error) {
return nil, ErrNoRows
}
func (c *NullTopicCache) GetUnsafe(id int) (*Topic, error) {
return nil, ErrNoRows
}
func (c *NullTopicCache) BulkGet(ids []int) (list []*Topic) {
return make([]*Topic, len(ids))
}
func (c *NullTopicCache) Set(_ *Topic) error {
return nil
}
func (c *NullTopicCache) Add(_ *Topic) error {
return nil
}
func (c *NullTopicCache) AddUnsafe(_ *Topic) error {
return nil
}
func (c *NullTopicCache) Remove(id int) error {
return nil
}
func (c *NullTopicCache) RemoveMany(ids []int) error {
return nil
}
func (c *NullTopicCache) RemoveUnsafe(id int) error {
return nil
}
func (c *NullTopicCache) Flush() {
}
func (c *NullTopicCache) Length() int {
return 0
}
func (c *NullTopicCache) SetCapacity(_ int) {
}
func (c *NullTopicCache) GetCapacity() int {
return 0
}