Documentation ¶
Index ¶
- Constants
- type Data
- type Project
- func (ps Project) Create(ctx context.Context, p model.Project) error
- func (ps Project) Delete(ctx context.Context, id string) error
- func (ps Project) Get(ctx context.Context, id string) (model.Project, error)
- func (ps Project) List(ctx context.Context) ([]model.Project, error)
- func (ps Project) Logs(ctx context.Context, name string, limit int) ([]model.ProjectLog, error)
- func (ps Project) Update(ctx context.Context, id string, fields map[string]interface{}) (model.Project, error)
- type Thing
- func (ts Thing) Create(ctx context.Context, t model.Thing) error
- func (ts Thing) GetByName(ctx context.Context, id string) (model.Thing, error)
- func (ts Thing) GetByProjectID(ctx context.Context, pid string) ([]model.Thing, error)
- func (ts Thing) Remove(ctx context.Context, id string) error
- func (ts Thing) Update(ctx context.Context, id string, m *string, s *bool) (model.Thing, error)
Constants ¶
View Source
const DataCollection = "data"
DataCollection is mongodb collection name for data.
View Source
const ProjectCollection = "project"
ProjectCollection is mongodb collection name for project.
View Source
const ThingCollection = "thing"
ThingCollection is mongodb collection name for things.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Data ¶
Data store handles database communication for data elements.
func (Data) Fetch ¶
func (d Data) Fetch(ctx context.Context, since, until, offset, limit int64, ids []string) ([]model.Data, error)
Fetch fetches given things data in given time range and sorts it. it uses disk for sort and etc.
type Project ¶
Project stores and retrieves projects collection.
type Thing ¶
Thing stores and retrieves things collection.
func (Thing) GetByProjectID ¶
GetByProjectID returns all things that are associated with given project identification.
Click to show internal directories.
Click to hide internal directories.