Package timehash

import "github.com/byte-mug/fastnntp-backend2/storage/timehash"

Overview

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.

Index

func LoadSM

func LoadSM(cfg *storage.CfgStorageMethod, bi *storage.CfgBaseInfo) (storage.StorageMethod, error)

-

type TimeHashSpool

type TimeHashSpool struct {
	SpoolPath string
	// contains filtered or unexported fields
}

-

func (*TimeHashSpool) Cancel

func (sm *TimeHashSpool) Cancel(t *storage.TOKEN) (err error)

-

func (*TimeHashSpool) Close

func (sm *TimeHashSpool) Close() error

-

func (*TimeHashSpool) Retrieve

func (sm *TimeHashSpool) Retrieve(t *storage.TOKEN, s storage.SMLevel) (a storage.Article_R, rs storage.SMLevel, err error)

-

func (*TimeHashSpool) Store

func (sm *TimeHashSpool) Store(md *storage.Article_MD, a storage.Article_W, t *storage.TOKEN) (err error)

-

Dependencies