incoming

package
v0.0.0-...-6aea55c Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2016 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Destination

type Destination interface {
	Notify(event.Event) error
}

type EventSource

type EventSource interface {
	SetStorage(EventStorage)
	Events() <-chan []*ReceivedEvent
}

type EventStorage

type EventStorage interface {
	Save(context.Context, int64, ...*ReceivedEvent) error
}

type GDatastoreStorage

type GDatastoreStorage struct {
	ProjectID string
}

func NewGDatastoreStorage

func NewGDatastoreStorage(projectID string) *GDatastoreStorage

func (*GDatastoreStorage) Delete

func (s *GDatastoreStorage) Delete(ctx context.Context, events ...*ReceivedEvent) error

func (*GDatastoreStorage) Save

func (s *GDatastoreStorage) Save(ctx context.Context, fireT int64, events ...*ReceivedEvent) error

type GPubSubSource

type GPubSubSource struct {
	Topic string // PubSub topic name
	// contains filtered or unexported fields
}

type HTTPSource

type HTTPSource struct {
	http.Handler

	Listen string
	// contains filtered or unexported fields
}

func NewHTTPSource

func NewHTTPSource() *HTTPSource

func (*HTTPSource) Events

func (s *HTTPSource) Events() <-chan []*ReceivedEvent

func (*HTTPSource) Loop

func (s *HTTPSource) Loop(ctx context.Context)

func (*HTTPSource) SetStorage

func (s *HTTPSource) SetStorage(es EventStorage)

type MemoryStorage

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

func NewMemoryStorage

func NewMemoryStorage() *MemoryStorage

func (*MemoryStorage) Save

func (ms *MemoryStorage) Save(ctx context.Context, t int64, events ...*ReceivedEvent) error

func (*MemoryStorage) Walk

func (ms *MemoryStorage) Walk(f func(int64, string, []*ReceivedEvent))

type ReceivedEvent

type ReceivedEvent struct {
	event.CoreAttrs
	// contains filtered or unexported fields
}

func NewEvent

func NewEvent(s EventSource, name string) *ReceivedEvent

func (ReceivedEvent) DeliveredOn

func (e ReceivedEvent) DeliveredOn() time.Time

func (ReceivedEvent) ID

func (e ReceivedEvent) ID() string

func (ReceivedEvent) ReceivedOn

func (e ReceivedEvent) ReceivedOn() time.Time

func (*ReceivedEvent) SetDeliveredOn

func (e *ReceivedEvent) SetDeliveredOn(t time.Time)

func (*ReceivedEvent) SetReceivedOn

func (e *ReceivedEvent) SetReceivedOn(t time.Time)

func (*ReceivedEvent) Source

func (e *ReceivedEvent) Source() EventSource

type Rule

type Rule struct{}

func (Rule) AggregationWindow

func (r Rule) AggregationWindow() int64

func (Rule) Disabled

func (r Rule) Disabled() bool

type RuleMap

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

func (*RuleMap) Get

func (m *RuleMap) Get(name string) (*Rule, error)

func (*RuleMap) Set

func (m *RuleMap) Set(name string, r *Rule)

type Server

type Server struct {
	Rules   RuleMap
	Sources []EventSource
	Storage EventStorage
}

func New

func New() *Server

func (*Server) AddSource

func (e *Server) AddSource(s EventSource)

func (*Server) Run

func (e *Server) Run(ctx context.Context) error

func (*Server) SetRule

func (e *Server) SetRule(evname string, r *Rule)

Jump to

Keyboard shortcuts

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