-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathentity.go
More file actions
24 lines (20 loc) · 623 Bytes
/
Copy pathentity.go
File metadata and controls
24 lines (20 loc) · 623 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package gohaystack
// An Entity is an abstraction for some physical object in the real world.
// Entity carries its tags and an ID
type Entity struct {
id *HaystackID // id is private because it should be immutable
Dis string // Dis is public because it is mutable
tags map[*Label]*Value
}
// GetTags from entity
func (e *Entity) GetTags() map[*Label]*Value {
return e.tags
}
// SetTag for the entity. No check is done and any existing label is silently overwritten.
func (e *Entity) SetTag(l *Label, v *Value) {
e.tags[l] = v
}
// GetID of the entity
func (e *Entity) GetID() *HaystackID {
return e.id
}