projects

package
v0.0.0-...-b10823d Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2013 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Project

type Project struct {
	ApiKey string
	// contains filtered or unexported fields
}

A Project is a collection of users and their events. In the landmarkd process, a Project simply links API keys to the table the project is stored on.

func New

func New(apiKey string, table sky.Table) *Project

Creates a new Project.

func (*Project) Track

func (p *Project) Track(user *core.User, device *core.Device, event *core.Event) error

Tracks an event.

type RedisStore

type RedisStore struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewRedisStore

func NewRedisStore(client sky.Client, uri *url.URL) *RedisStore

Creates a new Redis-backed project store.

func (*RedisStore) Close

func (s *RedisStore) Close()

Cleans up any remote connections.

func (*RedisStore) FindByApiKey

func (s *RedisStore) FindByApiKey(apiKey string) (*Project, error)

Looks up a project by API key. The store will look for a cached copy first and then check Redis.

func (*RedisStore) HashKey

func (s *RedisStore) HashKey() string

Retrieves the hash key used to lookup projects.

func (*RedisStore) Host

func (s *RedisStore) Host() string

Retrieves the host and port used to connect to Redis.

func (*RedisStore) Open

func (s *RedisStore) Open() error

Opens a connection to Redis.

type Store

type Store interface {
	Open() error
	Close()
	FindByApiKey(string) (*Project, error)
}

func NewStore

func NewStore(client sky.Client, uri string) (Store, error)

Creates new store based on a connection URI.

Jump to

Keyboard shortcuts

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