import "github.com/byte-mug/fastnntp-backend2/storage/timehash"
Implements a traditional storage method, where each article is stored in a separate file.
in the TIMEHASH method, each file is named:
<spoolpath>/time-nn/zzbb/cc/yyyy-aadd
Where "nn" is the hexadecimal value of the storage-class value, and "zzbb", "cc" and "aadd" are components of the arrival time in hexadecimal. The arrival time, in seconds since the epoch is converted to hexadecimal and interpreted as 0xzzaabbccdd. "yyyy" is the serial number.
func LoadSM(cfg *storage.CfgStorageMethod, bi *storage.CfgBaseInfo) (storage.StorageMethod, error)
-
type TimeHashSpool struct { SpoolPath string // contains filtered or unexported fields }
-
func (sm *TimeHashSpool) Cancel(t *storage.TOKEN) (err error)
-
func (sm *TimeHashSpool) Close() error
-
func (sm *TimeHashSpool) Retrieve(t *storage.TOKEN, s storage.SMLevel) (a storage.Article_R, rs storage.SMLevel, err error)
-
func (sm *TimeHashSpool) Store(md *storage.Article_MD, a storage.Article_W, t *storage.TOKEN) (err error)
-
import "encoding/binary"
import "fmt"
import "github.com/byte-mug/fastnntp-backend2/storage"
import "io"
import "os"
import "path/filepath"
import "sync/atomic"