datastore

package
v0.0.0-...-dfadd7b Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package datastore implements an interface to a redis datastore

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IdGenerator

type IdGenerator interface {
	Next() (int64, error)
}

type RedisEventStore

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

func NewRedisEventStore

func NewRedisEventStore(addr, port string) (RedisEventStore, error)

NewRedisEventStore opens a TCP connection to a redis server at the given address and port. It returns an intialised RedisEventStore struct as well as any error encountered.

func (*RedisEventStore) CountInTimeRange

func (store *RedisEventStore) CountInTimeRange(name string, start, end int64) (int, error)

CountInTimeRange returns an integer count of all events with a given name and timestamp between `start` and `end`, as well as any error encountered.

func (*RedisEventStore) Names

func (store *RedisEventStore) Names() ([]string, error)

Names returns a string slice containing all previously stored event names, as well as any error encountered.

func (*RedisEventStore) Put

func (store *RedisEventStore) Put(event domain.Event) error

Put stores a new event in redis, returning any error encountered.

type RedisIdGenerator

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

func (*RedisIdGenerator) Next

func (gen *RedisIdGenerator) Next() (int64, error)

Jump to

Keyboard shortcuts

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