Documentation
¶
Index ¶
- func CeAbstractBlob() serializer.CodecElement
- func CeArticlePosting() serializer.CodecElement
- func CeArticleRedirectPtr() serializer.CodecElement
- func CeArticleXover() serializer.CodecElement
- func CeArticleXoverStruct() serializer.CodecElement
- func CeXoverElement() serializer.CodecElement
- type AbstractBlob
- type ArticleLocation
- type ArticlePosting
- type ArticleRedirect
- type ArticleXover
- type BlobDirect
- type BlobLocation
- type BlobLz4Compressed
- type CompressionHint
- type Dayfile
- type DayfileCache
- func (dfc *DayfileCache) AddDayfileBlob(dayid int, ch CompressionHint, b AbstractBlob) AbstractBlob
- func (dfc *DayfileCache) Close() error
- func (dfc *DayfileCache) FreeDayfileStorage() int64
- func (dfc *DayfileCache) GetDayfileNodeID() *uuid.UUID
- func (dfc *DayfileCache) GetFile(dayid int) *Dayfile
- func (dfc *DayfileCache) Init(f LruCacheFactory) error
- func (dfc *DayfileCache) ReadDayfileBlob(b AbstractBlob) AbstractBlob
- type GrpArtDB
- func (g *GrpArtDB) GetArticle(group []byte, num int64, head, body bool) (headPtr, bodyPtr AbstractBlob, ok bool)
- func (g *GrpArtDB) GetXover(group []byte, first, last int64, max int) (result []XoverElement)
- func (g *GrpArtDB) Initialize() error
- func (g *GrpArtDB) PutArticle(group []byte, num int64, ap *ArticlePosting) (ok bool)
- type IDayfileNode
- type IGrpArtDB
- type IMsgidIndexDB
- type LruCache
- type LruCacheFactory
- type MsgidIndexDB
- type XoverElement
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CeAbstractBlob ¶
func CeAbstractBlob() serializer.CodecElement
func CeArticlePosting ¶
func CeArticlePosting() serializer.CodecElement
func CeArticleRedirectPtr ¶
func CeArticleRedirectPtr() serializer.CodecElement
func CeArticleXover ¶
func CeArticleXover() serializer.CodecElement
func CeArticleXoverStruct ¶
func CeArticleXoverStruct() serializer.CodecElement
func CeXoverElement ¶
func CeXoverElement() serializer.CodecElement
Types ¶
type AbstractBlob ¶
type AbstractBlob interface {
IsDirect() bool
}
func Decompress ¶
func Decompress(b AbstractBlob) AbstractBlob
Decompresses a blob (LZ4).
If b is nil, it returns nil. If b isn't a compressed Blob, it returns b unmodified. If b is compressed, but a non-decompressible Blob (corrupted or erroneous), it returns nil.
type ArticleLocation ¶
type ArticleLocation struct { Head AbstractBlob Body AbstractBlob }
type ArticlePosting ¶
type ArticlePosting struct { Xover ArticleXover Redir *ArticleRedirect Head AbstractBlob Body AbstractBlob // Compression hints. HeadComp CompressionHint BodyComp CompressionHint }
type ArticleRedirect ¶
type ArticleXover ¶
type BlobDirect ¶
type BlobDirect struct{ Content []byte }
func (*BlobDirect) IsDirect ¶
func (b *BlobDirect) IsDirect() bool
type BlobLocation ¶
func (*BlobLocation) IsDirect ¶
func (b *BlobLocation) IsDirect() bool
type BlobLz4Compressed ¶
func (*BlobLz4Compressed) IsDirect ¶
func (b *BlobLz4Compressed) IsDirect() bool
type CompressionHint ¶
type CompressionHint byte
const ( CH_None CompressionHint = 0 CH_LZ4 CompressionHint = 'z' CH_LZ4_HC CompressionHint = 'H' )
func (CompressionHint) Compress ¶
func (c CompressionHint) Compress(b AbstractBlob) AbstractBlob
func (CompressionHint) Lz4UseHC ¶
func (c CompressionHint) Lz4UseHC() bool
func (CompressionHint) UseLz4 ¶
func (c CompressionHint) UseLz4() bool
type Dayfile ¶
func (*Dayfile) Add ¶
func (d *Dayfile) Add(node *uuid.UUID, dayid int, ch CompressionHint, b AbstractBlob) (AbstractBlob, error)
func (*Dayfile) Read ¶
func (d *Dayfile) Read(b *BlobLocation) (res AbstractBlob, err error)
type DayfileCache ¶
type DayfileCache struct { Folder string NodeID *uuid.UUID // contains filtered or unexported fields }
func (*DayfileCache) AddDayfileBlob ¶
func (dfc *DayfileCache) AddDayfileBlob(dayid int, ch CompressionHint, b AbstractBlob) AbstractBlob
func (*DayfileCache) Close ¶
func (dfc *DayfileCache) Close() error
func (*DayfileCache) FreeDayfileStorage ¶
func (dfc *DayfileCache) FreeDayfileStorage() int64
func (*DayfileCache) GetDayfileNodeID ¶
func (dfc *DayfileCache) GetDayfileNodeID() *uuid.UUID
func (*DayfileCache) GetFile ¶
func (dfc *DayfileCache) GetFile(dayid int) *Dayfile
func (*DayfileCache) Init ¶
func (dfc *DayfileCache) Init(f LruCacheFactory) error
func (*DayfileCache) ReadDayfileBlob ¶
func (dfc *DayfileCache) ReadDayfileBlob(b AbstractBlob) AbstractBlob
type GrpArtDB ¶
func (*GrpArtDB) GetArticle ¶
func (*GrpArtDB) GetXover ¶
func (g *GrpArtDB) GetXover(group []byte, first, last int64, max int) (result []XoverElement)
func (*GrpArtDB) Initialize ¶
func (*GrpArtDB) PutArticle ¶
func (g *GrpArtDB) PutArticle(group []byte, num int64, ap *ArticlePosting) (ok bool)
type IDayfileNode ¶
type IDayfileNode interface { GetDayfileNodeID() *uuid.UUID FreeDayfileStorage() int64 AddDayfileBlob(dayid int, ch CompressionHint, b AbstractBlob) AbstractBlob ReadDayfileBlob(b AbstractBlob) AbstractBlob }
type IGrpArtDB ¶
type IGrpArtDB interface { PutArticle(group []byte, num int64, ap *ArticlePosting) (ok bool) GetArticle(group []byte, num int64, head, body bool) (headPtr, bodyPtr AbstractBlob, ok bool) GetXover(group []byte, first, last int64, max int) (result []XoverElement) }
type IMsgidIndexDB ¶
type IMsgidIndexDB interface { GetMessageLocation(messageID []byte) (articlePos *ArticleRedirect) UpdateMessageLocation(messageID []byte, articlePos *ArticleRedirect, timestamp int64) (ok bool) }
type LruCacheFactory ¶
type LruCacheFactory func(e simplelru.EvictCallback) (LruCache, error)
func NewLruCache ¶
func NewLruCache(size int) LruCacheFactory
Returns a simplistic LRU-Cache instance.
type MsgidIndexDB ¶
func (*MsgidIndexDB) GetMessageLocation ¶
func (g *MsgidIndexDB) GetMessageLocation(messageID []byte) (articlePos *ArticleRedirect)
func (*MsgidIndexDB) Initialize ¶
func (g *MsgidIndexDB) Initialize() error
func (*MsgidIndexDB) UpdateMessageLocation ¶
func (g *MsgidIndexDB) UpdateMessageLocation(messageID []byte, articlePos *ArticleRedirect, timestamp int64) (ok bool)
type XoverElement ¶
type XoverElement struct { Number int64 Xover ArticleXover }
Click to show internal directories.
Click to hide internal directories.