util

package
v0.0.0-...-321511a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2018 License: MIT Imports: 4 Imported by: 4

Documentation

Overview

Backend utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateId

func GenerateId() string

Generate a random identifier.

func NewDummyConversations

func NewDummyConversations(messages backend.MessagesBackend) backend.ConversationsBackend

func NewEchoSend

func NewEchoSend(target backend.MessagesBackend) backend.SendBackend

func NewNoopSend

func NewNoopSend() backend.SendBackend

Types

type DummyConversations

type DummyConversations struct {
	backend.MessagesBackend
}

A conversations backend that builds one conversation per message (no threads).

func (*DummyConversations) CountConversations

func (b *DummyConversations) CountConversations(user string) ([]*backend.MessagesCount, error)

func (*DummyConversations) DeleteConversation

func (b *DummyConversations) DeleteConversation(user, id string) error

func (*DummyConversations) GetConversation

func (b *DummyConversations) GetConversation(user, id string) (*backend.Conversation, error)

func (*DummyConversations) GetMessage

func (b *DummyConversations) GetMessage(user, id string) (*backend.Message, error)

func (*DummyConversations) InsertMessage

func (b *DummyConversations) InsertMessage(user string, msg *backend.Message) (*backend.Message, error)

func (*DummyConversations) ListConversationMessages

func (b *DummyConversations) ListConversationMessages(user, id string) ([]*backend.Message, error)

func (*DummyConversations) ListConversations

func (b *DummyConversations) ListConversations(user string, filter *backend.MessagesFilter) ([]*backend.Conversation, int, error)

func (*DummyConversations) ListMessages

func (b *DummyConversations) ListMessages(user string, filter *backend.MessagesFilter) ([]*backend.Message, int, error)

func (*DummyConversations) UpdateMessage

func (b *DummyConversations) UpdateMessage(user string, update *backend.MessageUpdate) (*backend.Message, error)

type EchoSend

type EchoSend struct {
	// contains filtered or unexported fields
}

A SendBackend that forwards all sent messages to a MessagesBackend.

func (*EchoSend) SendMessage

func (b *EchoSend) SendMessage(user string, msg *backend.OutgoingMessage) error

type NoopSend

type NoopSend struct{}

A SendBackend that does nothing.

func (*NoopSend) SendMessage

func (b *NoopSend) SendMessage(user string, msg *backend.OutgoingMessage) error

Directories

Path Synopsis
Provides utilities to parse and format messages.
Provides utilities to parse and format messages.
chunksplit
Provides a chunk splitter.
Provides a chunk splitter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL