Versions in this module Expand all Collapse all v1 v1.0.1 Sep 18, 2024 v1.0.0 May 17, 2024 Changes in this version + var ErrAutoFileClosed = errors.New("autofile is closed") + func GroupCheckDuration(duration time.Duration) func(*Group) + func GroupHeadSizeLimit(limit int64) func(*Group) + func GroupTotalSizeLimit(limit int64) func(*Group) + type AutoFile struct + ID string + Path string + func OpenAutoFile(ctx context.Context, path string) (*AutoFile, error) + func (af *AutoFile) Close() error + func (af *AutoFile) Size() (int64, error) + func (af *AutoFile) Sync() error + func (af *AutoFile) Write(b []byte) (n int, err error) + type Group struct + Dir string + Head *AutoFile + ID string + func OpenGroup(ctx context.Context, logger log.Logger, headPath string, ...) (*Group, error) + func (g *Group) Buffered() int + func (g *Group) Close() + func (g *Group) FlushAndSync() error + func (g *Group) HeadSizeLimit() int64 + func (g *Group) MaxIndex() int + func (g *Group) MinIndex() int + func (g *Group) NewReader(index int) (*GroupReader, error) + func (g *Group) OnStart(ctx context.Context) error + func (g *Group) OnStop() + func (g *Group) ReadGroupInfo() GroupInfo + func (g *Group) TotalSizeLimit() int64 + func (g *Group) Write(p []byte) (nn int, err error) + func (g *Group) WriteLine(line string) error + type GroupInfo struct + HeadSize int64 + MaxIndex int + MinIndex int + TotalSize int64 + type GroupReader struct + func (gr *GroupReader) Close() error + func (gr *GroupReader) CurIndex() int + func (gr *GroupReader) Read(p []byte) (n int, err error) + func (gr *GroupReader) SetIndex(index int) error