Documentation
¶
Index ¶
- func EscapeFilename(unsafe string) (safe string)
- func IsFSStore(store Store) bool
- func IsMemoryStore(store Store) bool
- func NewDBStore(db database.Database) *dbMessageStore
- func NewFSStore(root string, user *database.User) *fsMessageStore
- func NewMemoryStore() *memoryMessageStore
- func ParseMsgID(s string, body msgIDBody) (netID int64, target string, err error)
- type ChatHistoryStore
- type ChatHistoryTarget
- type LoadMessageOptions
- type RenameNetworkStore
- type SearchMessageOptions
- type SearchStore
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EscapeFilename ¶
func IsMemoryStore ¶
func NewDBStore ¶
func NewFSStore ¶
func NewMemoryStore ¶
func NewMemoryStore() *memoryMessageStore
Types ¶
type ChatHistoryStore ¶
type ChatHistoryStore interface {
Store
// ListTargets lists channels and nicknames by time of the latest message.
// It returns up to limit targets, starting from start and ending on end,
// both excluded. end may be before or after start.
// If events is false, only PRIVMSG/NOTICE messages are considered.
ListTargets(ctx context.Context, network *database.Network, start, end time.Time, limit int, events bool) ([]ChatHistoryTarget, error)
// LoadBeforeTime loads up to limit messages before start down to end. The
// returned messages must be between and excluding the provided bounds.
// end is before start.
// If events is false, only PRIVMSG/NOTICE messages are considered.
LoadBeforeTime(ctx context.Context, start, end time.Time, options *LoadMessageOptions) ([]*irc.Message, error)
// LoadAfterTime loads up to limit messages after start up to end. The
// returned messages must be between and excluding the provided bounds.
// end is after start.
// If events is false, only PRIVMSG/NOTICE messages are considered.
LoadAfterTime(ctx context.Context, start, end time.Time, options *LoadMessageOptions) ([]*irc.Message, error)
}
ChatHistoryStore is a message store that supports chat history operations.
type ChatHistoryTarget ¶
type LoadMessageOptions ¶
type RenameNetworkStore ¶
RenameNetworkStore is a message store which needs to be notified of network name changes.
type SearchMessageOptions ¶
type SearchStore ¶
type SearchStore interface {
Store
// Search returns messages matching the specified options.
Search(ctx context.Context, network *database.Network, options *SearchMessageOptions) ([]*irc.Message, error)
}
SearchStore is a message store that supports server-side search operations.
type Store ¶
type Store interface {
Close() error
// LastMsgID queries the last message ID for the given network, entity and
// date. The message ID returned may not refer to a valid message, but can be
// used in history queries.
LastMsgID(ctx context.Context, network *database.Network, entity string, t time.Time) (string, error)
// LoadLatestID queries the latest non-event messages for the given network,
// entity and date, up to a count of limit messages, sorted from oldest to newest.
LoadLatestID(ctx context.Context, id string, options *LoadMessageOptions) ([]*irc.Message, error)
Append(ctx context.Context, network *database.Network, entity string, msg *irc.Message) (id string, err error)
}
Store is a per-user store for IRC messages.
Click to show internal directories.
Click to hide internal directories.