fixing comments (golint)

This commit is contained in:
kayos 2021-05-07 22:45:38 -07:00
parent 5e3cce9e1c
commit 1655557abb

@ -8,7 +8,7 @@ import (
var db *bitcask.Bitcask var db *bitcask.Bitcask
// these values should be defined by config // DataDir - should be defined by config
var DataDir string = "./.eros-data" var DataDir string = "./.eros-data"
// // // //
@ -22,20 +22,20 @@ var DataDir string = "./.eros-data"
// Services UUIDs (Services) // 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 { type Details struct {
LocalName string LocalName string
Advertisement []byte Advertisement []byte
Services []string 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 { type Device struct {
MAC string MAC string
Info Details 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() { func Awaken() {
//log.Debug().Str("DataDir",DataDir).Msg("Initializing eros...") //log.Debug().Str("DataDir",DataDir).Msg("Initializing eros...")
db, err := bitcask.Open(DataDir) 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 { func Remember(mac string, name string, adv []byte, services []string) error {
var err error var err error
@ -70,7 +70,7 @@ func Remember(mac string, name string, adv []byte, services []string) error {
return err return err
} }
// retrieve device details from the database // Recall - retrieve device details from the database
func Recall(mac string) (Device, error) { func Recall(mac string) (Device, error) {
var err error var err error
var bytes []byte var bytes []byte