fixing comments (golint)
This commit is contained in:
parent
5e3cce9e1c
commit
1655557abb
@ -8,7 +8,7 @@ import (
|
||||
|
||||
var db *bitcask.Bitcask
|
||||
|
||||
// these values should be defined by config
|
||||
// DataDir - should be defined by config
|
||||
var DataDir string = "./.eros-data"
|
||||
|
||||
// //
|
||||
@ -22,20 +22,20 @@ var DataDir string = "./.eros-data"
|
||||
// Services UUIDs (Services)
|
||||
//
|
||||
|
||||
// this struct is to be marshalled into json before stored in bitcask
|
||||
// Details - to be marshalled into json before stored in bitcask
|
||||
type Details struct {
|
||||
LocalName string
|
||||
Advertisement []byte
|
||||
Services []string
|
||||
}
|
||||
|
||||
// we use this to nest the populated Details struct associated with the MAC
|
||||
// Device - we use this to nest the populated Details struct associated with the MAC
|
||||
type Device struct {
|
||||
MAC string
|
||||
Info Details
|
||||
}
|
||||
|
||||
// create the data directory if it does not exist; initialize bitcask in this directory
|
||||
// Awaken - create the data directory if it does not exist; initialize bitcask in this directory
|
||||
func Awaken() {
|
||||
//log.Debug().Str("DataDir",DataDir).Msg("Initializing eros...")
|
||||
db, err := bitcask.Open(DataDir)
|
||||
@ -44,7 +44,7 @@ func Awaken() {
|
||||
}
|
||||
}
|
||||
|
||||
// store device details into the database
|
||||
// Remember - store device details into the database
|
||||
func Remember(mac string, name string, adv []byte, services []string) error {
|
||||
var err error
|
||||
|
||||
@ -70,7 +70,7 @@ func Remember(mac string, name string, adv []byte, services []string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// retrieve device details from the database
|
||||
// Recall - retrieve device details from the database
|
||||
func Recall(mac string) (Device, error) {
|
||||
var err error
|
||||
var bytes []byte
|
||||
|
Loading…
Reference in New Issue
Block a user