Documentation ¶
Index ¶
- type CacheDB
- type Cacher
- type MainDB
- func (d MainDB) AddMessage(m *Message) (string, error)
- func (d MainDB) AddUser(u *User) error
- func (d MainDB) DeleteMessage(id string) error
- func (d MainDB) GetLastPublicMessages(skip int) (MessagesOut, error)
- func (d MainDB) GetMessage(id string) (MessageOut, error)
- func (d MainDB) GetUser(username string) (UserOut, error)
- func (d MainDB) GetUserMessages(ownerId string) (MessagesOut, error)
- func (d *MainDB) Shutdown(ctx context.Context) error
- func (d MainDB) UpdateMessage(id string, m *Message) error
- type Message
- type MessageOut
- type MessagesDB
- type MessagesOut
- type Storager
- type User
- type UserOut
- type UsersDB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheDB ¶
type CacheDB struct {
// contains filtered or unexported fields
}
func NewCacheDB ¶
type MainDB ¶
type MainDB struct {
// contains filtered or unexported fields
}
func (MainDB) DeleteMessage ¶
func (MainDB) GetLastPublicMessages ¶
func (d MainDB) GetLastPublicMessages(skip int) (MessagesOut, error)
func (MainDB) GetMessage ¶
func (d MainDB) GetMessage(id string) (MessageOut, error)
func (MainDB) GetUserMessages ¶
func (d MainDB) GetUserMessages(ownerId string) (MessagesOut, error)
type Message ¶
type Message struct { OwnerId string `json:"owner_id" bson:"owner_id"` Content string `json:"content" bson:"content"` IsPrivate bool `json:"is_private" bson:"is_private"` EncodingType string `json:"encoding_type" bson:"encoding_type"` Password string `json:"password" bson:"password"` OnlyOwnerView bool `json:"only_owner_view" bson:"only_owner_view"` IsAnon bool `json:"is_anon" bson:"is_anon"` IsOneTime bool `json:"is_one_time" bson:"is_one_time"` }
type MessageOut ¶
type MessageOut struct { Id primitive.ObjectID `json:"id" bson:"_id"` OwnerId string `json:"owner_id,omitempty" bson:"owner_id"` Content string `json:"content" bson:"content"` IsPrivate bool `json:"is_private" bson:"is_private"` EncodingType string `json:"encoding_type" bson:"encoding_type"` Password string `json:"password,omitempty" bson:"password"` OnlyOwnerView bool `json:"only_owner_view" bson:"only_owner_view"` IsAnon bool `json:"is_anon" bson:"is_anon"` IsOneTime bool `json:"is_one_time" bson:"is_one_time"` }
type MessagesDB ¶
type MessagesOut ¶
type MessagesOut []MessageOut
Click to show internal directories.
Click to hide internal directories.