Documentation ¶
Index ¶
- func GetConfigEntry(node_type string) (interface{}, error)
- func GetSession(collection string) (*mgo.Session, *mgo.Collection, error)
- func MakeNodeID(length int) string
- func RemoveNodeEntry(node_type, id string) error
- func SetConfig(c *config.Server)
- func SetConfigEntry(node_type string, config interface{}) error
- func UpdateNodeEntry(node_type, id string, request NodeCreateRequest) error
- func UpdateNodeEntryLastSeen(node_type, id string) error
- type ConfigEntry
- type NodeCreateRequest
- type NodeEntry
- type ValidationError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetConfigEntry ¶
func GetSession ¶ added in v1.1.0
func MakeNodeID ¶
func RemoveNodeEntry ¶
func SetConfigEntry ¶
func UpdateNodeEntry ¶
func UpdateNodeEntry(node_type, id string, request NodeCreateRequest) error
func UpdateNodeEntryLastSeen ¶
Types ¶
type ConfigEntry ¶
type ConfigEntry struct { NodeType string `json:"node_type" bson:"_id"` LastUpdated time.Time `json:"lastUpdated" bson:"lastUpdated"` Configuration interface{} `json:"config" bson:"config"` }
func (ConfigEntry) FromMap ¶
func (c ConfigEntry) FromMap(m bson.M) ConfigEntry
func (ConfigEntry) ToMap ¶
func (c ConfigEntry) ToMap() bson.M
type NodeCreateRequest ¶
type NodeEntry ¶
type NodeEntry struct { ID string `json:"id" bson:"_id"` NodeType string `json:"node_type" bson:"node_type"` Hostname string `json:"hostname" bson:"hostname"` Port int `json:"port" bson:"port"` LastSeen time.Time `json:"lastSeen" bson:"lastSeen"` }
func CreateNodeEntry ¶
func CreateNodeEntry(node_type string, request NodeCreateRequest) (NodeEntry, error)
func GetNodeEntries ¶
func GetNodeEntry ¶
type ValidationError ¶
type ValidationError struct {
// contains filtered or unexported fields
}
func (ValidationError) Error ¶
func (e ValidationError) Error() string
Click to show internal directories.
Click to hide internal directories.