func (a *Api) ReadData(d filestore.DataPoint) { f := filestore.OpenForRead(a.filename) defer f.Close() stat, _ := f.Stat() filesize := stat.Size() fmt.Println(filesize, d.Size(), filesize/d.Size()) err := d.Read(f) if err != nil { fmt.Println("Error", err) } }
func (a *Api) WriteData(d filestore.DataPoint) { f := filestore.OpenForWrite(a.filename) defer f.Close() d.Write(f) }