Documentation ¶
Overview ¶
* Copyright 2020, Ulf Lilleengen * License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html).
* Copyright 2020, Ulf Lilleengen * License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html).
* Copyright 2019, Ulf Lilleengen * License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html).
* Copyright 2020, Ulf Lilleengen * License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html).
* Copyright 2019, Ulf Lilleengen * License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html).
Index ¶
- Constants
- func Flusher(flushInterval time.Duration, ds Datastore)
- func GarbageCollector(gcInterval time.Duration, ds Datastore)
- func NewFileDatastore(dataDir string, maxLogAge int64, maxLogSize int64) (*fileDatastore, error)
- func OpenMapped(path string) (*mappedFile, error)
- type Datastore
- type MemoryDatastore
- func (m *MemoryDatastore) Close()
- func (m *MemoryDatastore) CreateTopic(topic string) error
- func (m *MemoryDatastore) Flush() error
- func (m *MemoryDatastore) GarbageCollect(topic string) error
- func (m *MemoryDatastore) Initialize() error
- func (m *MemoryDatastore) InsertMessage(topic string, message *api.Message) error
- func (m *MemoryDatastore) LastOffset(topic string) (int64, error)
- func (m *MemoryDatastore) ListTopics() ([]string, error)
- func (m *MemoryDatastore) NumMessages(topic string) (int64, error)
- func (m *MemoryDatastore) StreamMessages(topic string, offset int64, callback StreamingFunc) error
- type SqlDatastore
- func (ds SqlDatastore) Close()
- func (ds SqlDatastore) CreateTopic(topic string) error
- func (ds SqlDatastore) Flush() error
- func (ds SqlDatastore) GarbageCollect(topic string) error
- func (ds SqlDatastore) Initialize() error
- func (ds SqlDatastore) InsertMessage(topic string, message *api.Message) error
- func (ds SqlDatastore) LastOffset(topic string) (int64, error)
- func (ds SqlDatastore) ListMessages(topic string, limit int64, offset int64, insertionTime int64) ([]*api.Message, error)
- func (ds SqlDatastore) ListTopics() ([]string, error)
- func (ds SqlDatastore) NumMessages(topic string) (int64, error)
- func (ds SqlDatastore) StreamMessages(topic string, offset int64, callback StreamingFunc) error
- type StreamingFunc
Constants ¶
View Source
const METADATA_SZ int64 = int64(16)
Variables ¶
This section is empty.
Functions ¶
func GarbageCollector ¶
func NewFileDatastore ¶
func OpenMapped ¶
Types ¶
type Datastore ¶
type Datastore interface { Initialize() error CreateTopic(topic string) error InsertMessage(topic string, message *api.Message) error StreamMessages(topic string, offset int64, callback StreamingFunc) error // Read the number of events stored NumMessages(topic string) (int64, error) LastOffset(topic string) (int64, error) Flush() error GarbageCollect(topic string) error ListTopics() ([]string, error) Close() }
type MemoryDatastore ¶
type MemoryDatastore struct {
// contains filtered or unexported fields
}
func NewMemoryDatastore ¶
func NewMemoryDatastore() (*MemoryDatastore, error)
func (*MemoryDatastore) Close ¶
func (m *MemoryDatastore) Close()
func (*MemoryDatastore) CreateTopic ¶
func (m *MemoryDatastore) CreateTopic(topic string) error
func (*MemoryDatastore) Flush ¶
func (m *MemoryDatastore) Flush() error
func (*MemoryDatastore) GarbageCollect ¶
func (m *MemoryDatastore) GarbageCollect(topic string) error
func (*MemoryDatastore) Initialize ¶
func (m *MemoryDatastore) Initialize() error
func (*MemoryDatastore) InsertMessage ¶
func (m *MemoryDatastore) InsertMessage(topic string, message *api.Message) error
func (*MemoryDatastore) LastOffset ¶
func (m *MemoryDatastore) LastOffset(topic string) (int64, error)
func (*MemoryDatastore) ListTopics ¶
func (m *MemoryDatastore) ListTopics() ([]string, error)
func (*MemoryDatastore) NumMessages ¶
func (m *MemoryDatastore) NumMessages(topic string) (int64, error)
func (*MemoryDatastore) StreamMessages ¶
func (m *MemoryDatastore) StreamMessages(topic string, offset int64, callback StreamingFunc) error
type SqlDatastore ¶
type SqlDatastore struct {
// contains filtered or unexported fields
}
func NewSqliteDatastore ¶
func NewSqliteDatastore(dataDir string, maxLogAge int64, maxLogSize int64) (*SqlDatastore, error)
func (SqlDatastore) Close ¶
func (ds SqlDatastore) Close()
func (SqlDatastore) CreateTopic ¶
func (ds SqlDatastore) CreateTopic(topic string) error
func (SqlDatastore) Flush ¶
func (ds SqlDatastore) Flush() error
func (SqlDatastore) GarbageCollect ¶
func (ds SqlDatastore) GarbageCollect(topic string) error
func (SqlDatastore) Initialize ¶
func (ds SqlDatastore) Initialize() error
func (SqlDatastore) InsertMessage ¶
func (ds SqlDatastore) InsertMessage(topic string, message *api.Message) error
func (SqlDatastore) LastOffset ¶
func (ds SqlDatastore) LastOffset(topic string) (int64, error)
func (SqlDatastore) ListMessages ¶
func (SqlDatastore) ListTopics ¶
func (ds SqlDatastore) ListTopics() ([]string, error)
func (SqlDatastore) NumMessages ¶
func (ds SqlDatastore) NumMessages(topic string) (int64, error)
func (SqlDatastore) StreamMessages ¶
func (ds SqlDatastore) StreamMessages(topic string, offset int64, callback StreamingFunc) error
type StreamingFunc ¶
Click to show internal directories.
Click to hide internal directories.