Documentation
¶
Index ¶
- func AggregateTypeTest(t *testing.T, d DataBackend)
- func DateRangeFilterTest(t *testing.T, d DataBackend)
- func InsertUpdateTest(t *testing.T, d DataBackend)
- func NewHub(d DataBackend) *hub
- func NewProcessorList() *processorList
- func QueryByTest(t *testing.T, d DataBackend)
- func QueryTest(t *testing.T, d DataBackend)
- func RunDataBackendSuite(t *testing.T, d DataBackend, clear clearfunc)
- type Broadcaster
- type ByDate
- type DataBackend
- type DataService
- type Event
- type EventFeed
- type Events
- type LocalMemoryStore
- type MatchArray
- type Processor
- type Query
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AggregateTypeTest ¶
func AggregateTypeTest(t *testing.T, d DataBackend)
func DateRangeFilterTest ¶
func DateRangeFilterTest(t *testing.T, d DataBackend)
func InsertUpdateTest ¶
func InsertUpdateTest(t *testing.T, d DataBackend)
func NewHub ¶
func NewHub(d DataBackend) *hub
func QueryByTest ¶
func QueryByTest(t *testing.T, d DataBackend)
func QueryTest ¶
func QueryTest(t *testing.T, d DataBackend)
func RunDataBackendSuite ¶
func RunDataBackendSuite(t *testing.T, d DataBackend, clear clearfunc)
Types ¶
type Broadcaster ¶
type DataBackend ¶
type DataBackend interface { Save(e *Event) error GetById(id int) (*Event, error) Query(q Query) ([]*Event, error) AggregateType(q Query, s string) (map[string]int, error) }
Queryable Data store
type DataService ¶
type DataService interface {
Run(d DataBackend, ec chan error)
}
type Event ¶
type Event struct { ID int `json:"id"` Key string `json:"key"` KeyParams interface{} `json:"key_params"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` Payload interface{} `json:"payload"` Description string `json:"description"` Importance int `json:"importance"` Origin string `json:"origin"` Entities []string `json:"entities"` OtherReferences []string `json:"other_references"` Actors []string `json:"actors"` Tags []string `json:"tags"` }
type LocalMemoryStore ¶
type LocalMemoryStore struct {
// contains filtered or unexported fields
}
func NewLocalMemoryStore ¶
func NewLocalMemoryStore() *LocalMemoryStore
func (*LocalMemoryStore) AggregateType ¶
func (*LocalMemoryStore) Clear ¶
func (d *LocalMemoryStore) Clear()
func (*LocalMemoryStore) Save ¶
func (d *LocalMemoryStore) Save(e *Event) error
type MatchArray ¶
type MatchArray [2][]string
func (MatchArray) Match ¶
func (m MatchArray) Match() bool
Given two string arrays, returns true if the value array contains all of the query array's values
type Processor ¶
Processor is a function which modifies the contents of the event and emits any errors to the error channel
type Query ¶
type Query struct { Origin string `url:"origin,omitempty" schema:"origin" json:"origin"` Key string `url:"key,omitempty" schema:"key" json:"key"` Entities []string `url:"entities,omitempty" schema:"entities" json:"entities"` OtherReferences []string `url:"other_references,omitempty" schema:"other_references" json:"other_references"` Actors []string `url:"actors,omitempty" schema:"actors" json:"actors"` Tags []string `url:"tags,omitempty" schema:"tags" json:"tags"` Importance string `url:"importance,omitempty" schema:"importance" json:"importance"` From time.Time `url:"from,omitempty" schema:"from" json:"from"` To time.Time `url:"to,omitempty" schema:"to" json:"to"` }
TODO: Created/Updated, lt & gt TODO: Importance, 1+OR+3 gt1 lt4. single param TODO: Sort & direction
func QueryFromString ¶
func (*Query) IsValidArrayType ¶
Return true if s is a valid array type
Click to show internal directories.
Click to hide internal directories.