27 lines
526 B
Go
27 lines
526 B
Go
package db
|
|
|
|
import (
|
|
"fmt"
|
|
"th7/data/core"
|
|
)
|
|
|
|
type DummyAdapter struct {
|
|
}
|
|
|
|
func NewDummyAdapter() (*DummyAdapter, error) {
|
|
return &DummyAdapter{}, nil
|
|
}
|
|
|
|
func (d *DummyAdapter) Close() {
|
|
fmt.Println("Closing DB ...")
|
|
}
|
|
|
|
func (d *DummyAdapter) Save(channels []core.Channel) error {
|
|
fmt.Println("=======================================")
|
|
for _, val := range channels {
|
|
fmt.Printf("Saved: id=%d, unit=%d, value=%g\n", val.Id, val.Unit, val.Value)
|
|
}
|
|
fmt.Println("=======================================")
|
|
return nil
|
|
}
|