journal

package
Version: v0.0.0-...-b9d044a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2015 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Head = JournalFileType('b')
	Rest = JournalFileType('q')
)

Variables

View Source
var NilJournalPathInfo = JournalPathInfo{"", 0, "", "", 0, nil}

Functions

func BuildJournalPathWithTSuffix

func BuildJournalPathWithTSuffix(key string, bq JournalFileType, tSuffix string) string

func IsValidJournalPathInfo

func IsValidJournalPathInfo(info JournalPathInfo) bool

Types

type FileJournal

type FileJournal struct {
	// contains filtered or unexported fields
}

func (*FileJournal) AddFlushListener

func (journal *FileJournal) AddFlushListener(listener ik.JournalChunkListener)

func (*FileJournal) AddNewChunkListener

func (journal *FileJournal) AddNewChunkListener(listener ik.JournalChunkListener)

func (*FileJournal) Dispose

func (journal *FileJournal) Dispose() error

func (*FileJournal) Flush

func (journal *FileJournal) Flush(visitor func(ik.JournalChunk) error) error

func (*FileJournal) GetTailChunk

func (journal *FileJournal) GetTailChunk() ik.JournalChunk

func (*FileJournal) Key

func (journal *FileJournal) Key() string

func (*FileJournal) Purge

func (journal *FileJournal) Purge() error

func (*FileJournal) Write

func (journal *FileJournal) Write(data []byte) error

type FileJournalChunk

type FileJournalChunk struct {
	Path      string
	Type      JournalFileType
	TSuffix   string
	Timestamp int64
	UniqueId  []byte
	// contains filtered or unexported fields
}

type FileJournalChunkDequeue

type FileJournalChunkDequeue struct {
	// contains filtered or unexported fields
}

type FileJournalChunkDequeueHead

type FileJournalChunkDequeueHead struct {
	// contains filtered or unexported fields
}

type FileJournalChunkWrapper

type FileJournalChunkWrapper struct {
	// contains filtered or unexported fields
}

func (*FileJournalChunkWrapper) Dispose

func (wrapper *FileJournalChunkWrapper) Dispose() error

func (*FileJournalChunkWrapper) GetNextChunk

func (wrapper *FileJournalChunkWrapper) GetNextChunk() ik.JournalChunk

func (*FileJournalChunkWrapper) GetReader

func (wrapper *FileJournalChunkWrapper) GetReader() (io.Reader, error)

func (*FileJournalChunkWrapper) Path

func (wrapper *FileJournalChunkWrapper) Path() string

func (*FileJournalChunkWrapper) TakeOwnership

func (wrapper *FileJournalChunkWrapper) TakeOwnership() bool

type FileJournalGroup

type FileJournalGroup struct {
	// contains filtered or unexported fields
}

func (*FileJournalGroup) Dispose

func (journalGroup *FileJournalGroup) Dispose() error

func (*FileJournalGroup) GetFileJournal

func (journalGroup *FileJournalGroup) GetFileJournal(key string) *FileJournal

func (*FileJournalGroup) GetJournal

func (journalGroup *FileJournalGroup) GetJournal(key string) ik.Journal

func (*FileJournalGroup) GetJournalKeys

func (journalGroup *FileJournalGroup) GetJournalKeys() []string

type FileJournalGroupFactory

type FileJournalGroupFactory struct {
	// contains filtered or unexported fields
}

func NewFileJournalGroupFactory

func NewFileJournalGroupFactory(
	logger ik.Logger,
	randSource rand.Source,
	timeGetter func() time.Time,
	defaultPathSuffix string,
	defaultFileMode os.FileMode,
	maxSize int64,
) *FileJournalGroupFactory

func (*FileJournalGroupFactory) GetJournalGroup

func (factory *FileJournalGroupFactory) GetJournalGroup(path string, pluginInstance ik.PluginInstance) (*FileJournalGroup, error)

type JournalFileType

type JournalFileType rune

type JournalPathInfo

type JournalPathInfo struct {
	Key             string
	Type            JournalFileType
	VariablePortion string
	TSuffix         string
	Timestamp       int64 // elapsed time in msec since epoch
	UniqueId        []byte
}

func BuildJournalPath

func BuildJournalPath(key string, bq JournalFileType, time_ time.Time, randValue int64) JournalPathInfo

func DecodeJournalPath

func DecodeJournalPath(variablePortion string) (JournalPathInfo, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL