Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClosableStore ¶
type Message ¶
type Message struct {
ID string `json:"id"`
Type string `json:"type"`
Room string `json:"room,omitempty"`
UserID string `json:"user_id,omitempty"`
DisplayName string `json:"display_name,omitempty"`
Doc string `json:"doc,omitempty"`
Body string `json:"body,omitempty"`
Rooms []string `json:"rooms,omitempty"`
Users []string `json:"users,omitempty"`
Items []string `json:"items,omitempty"`
History []Message `json:"history,omitempty"`
Limit int `json:"limit,omitempty"`
Timestamp time.Time `json:"timestamp"`
}
type Options ¶
type Options struct {
AllowedOrigins []string
MaxMessageBytes int64
MaxBodyLength int
MaxRoomLength int
MaxUserLength int
HistoryLimit int
SendBuffer int
SaveBuffer int
StoreTimeout time.Duration
WriteWait time.Duration
PongWait time.Duration
PingPeriod time.Duration
JWTSecret string
JWTIssuer string
JWTAudience string
}
type PostgresStore ¶
type PostgresStore struct {
// contains filtered or unexported fields
}
func NewPostgresStore ¶
func NewPostgresStore(dsn string) (*PostgresStore, error)
func (*PostgresStore) Close ¶
func (s *PostgresStore) Close() error
func (*PostgresStore) ListMessages ¶
func (*PostgresStore) SaveMessage ¶
func (s *PostgresStore) SaveMessage(ctx context.Context, msg Message) error
type SQLiteStore ¶
type SQLiteStore struct {
// contains filtered or unexported fields
}
func NewSQLiteStore ¶
func NewSQLiteStore(path string) (*SQLiteStore, error)
func (*SQLiteStore) Close ¶
func (s *SQLiteStore) Close() error
func (*SQLiteStore) ListMessages ¶
func (*SQLiteStore) SaveMessage ¶
func (s *SQLiteStore) SaveMessage(ctx context.Context, msg Message) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.