Documentation ¶
Index ¶
- func DeleteByUUID(uuid uuid.UUID) bool
- type Comment
- type NewsItem
- type NewsItemStorage
- type RedisNewsItemStorage
- func (rnis *RedisNewsItemStorage) Delete(uuid uuid.UUID) error
- func (rnis *RedisNewsItemStorage) Load(uuid uuid.UUID) (*NewsItem, error)
- func (rnis *RedisNewsItemStorage) LoadAll() ([]*NewsItem, error)
- func (rnis *RedisNewsItemStorage) LoadByAuthor(author uuid.UUID) ([]*NewsItem, error)
- func (rnis *RedisNewsItemStorage) Store(c *NewsItem) error
- type Tag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteByUUID ¶
Types ¶
type NewsItem ¶
type NewsItem struct { UUID uuid.UUID `json:"uuid"` Author uuid.UUID `json:"author"` Created time.Time `json:"created"` Tag Tag `json:"tag"` Title string `json:"title"` Leadin string `json:"leadin"` Body string `json:"body"` Picture []byte `json:"picture"` Comments []Comment `json:"comments"` }
func AllNewsItems ¶
func NewNewsItem ¶
Create a NewsItem
func (*NewsItem) RemoveCommentsByPlayer ¶
func (*NewsItem) UpdateNewsItem ¶
type NewsItemStorage ¶
type NewsItemStorage interface { Store(*NewsItem) error Delete(uuid.UUID) error Load(uuid.UUID) (*NewsItem, error) LoadAll() ([]*NewsItem, error) LoadByAuthor(uuid.UUID) ([]*NewsItem, error) }
A storage interface for News
type RedisNewsItemStorage ¶
type RedisNewsItemStorage struct {
// contains filtered or unexported fields
}
func NewRedisNewsItemStorage ¶
func NewRedisNewsItemStorage() *RedisNewsItemStorage
func (*RedisNewsItemStorage) Delete ¶
func (rnis *RedisNewsItemStorage) Delete(uuid uuid.UUID) error
func (*RedisNewsItemStorage) Load ¶
func (rnis *RedisNewsItemStorage) Load(uuid uuid.UUID) (*NewsItem, error)
func (*RedisNewsItemStorage) LoadAll ¶
func (rnis *RedisNewsItemStorage) LoadAll() ([]*NewsItem, error)
func (*RedisNewsItemStorage) LoadByAuthor ¶
func (rnis *RedisNewsItemStorage) LoadByAuthor(author uuid.UUID) ([]*NewsItem, error)
func (*RedisNewsItemStorage) Store ¶
func (rnis *RedisNewsItemStorage) Store(c *NewsItem) error
Click to show internal directories.
Click to hide internal directories.