Documentation ¶
Index ¶
- Variables
- func SafeFilename(kind component.Kind, ent component.ID, name string) string
- type Boxer
- func (b *Boxer) Close() error
- func (b *Boxer) CloseInterval(interval int64) error
- func (b *Boxer) CloseIntervalScope(interval int64, scope string) error
- func (b *Boxer) ForEach(interval int64, scope string, fn BoxerForEachFunc) error
- func (b *Boxer) GetAllIntervals() ([]int64, error)
- func (b *Boxer) GetClosedIntervals(ts time.Time) ([]int64, error)
- func (b *Boxer) GetScopesForInterval(interval int64) ([]string, error)
- func (b *Boxer) IntervalForTime(ts time.Time) int64
- func (b *Boxer) Put(scope string, ts time.Time, item []byte) (tooold bool, err error)
- func (b *Boxer) TimeForInterval(interval int64) time.Time
- type BoxerForEachFunc
- type BoxerOptions
- type Buffer
- type BufferRecord
- type FileItem
- type FilesystemBuffer
- func (b *FilesystemBuffer) CloseInterval(interval int64) error
- func (b *FilesystemBuffer) CloseIntervalScope(interval int64, scope string) error
- func (b *FilesystemBuffer) ForEach(interval int64, scope string, fn ForEachFunc) error
- func (b *FilesystemBuffer) GetIntervals() (intervals []int64, err error)
- func (b *FilesystemBuffer) GetScopes(interval int64) (scopes []string, err error)
- func (b *FilesystemBuffer) Shutdown() error
- func (b *FilesystemBuffer) Write(data *BufferRecord) error
- type ForEachFunc
- type MemoryBuffer
- func (b *MemoryBuffer) CloseInterval(interval int64) error
- func (b *MemoryBuffer) CloseIntervalScope(interval int64, scope string) error
- func (b *MemoryBuffer) ForEach(interval int64, scope string, fn ForEachFunc) error
- func (b *MemoryBuffer) GetIntervals() (intervals []int64, err error)
- func (b *MemoryBuffer) GetScopes(interval int64) (scopes []string, err error)
- func (b *MemoryBuffer) Shutdown() error
- func (b *MemoryBuffer) Wipe() error
- func (b *MemoryBuffer) Write(data *BufferRecord) error
- type MemoryItem
- type TimeFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( NoSuchIntervalError = errors.New("no such interval") NoSuchScopeError = errors.New("no such scope") )
View Source
var ( ErrShutdown = errors.New("buffer is shut down") WriteError = errors.New("error writing to buffer") )
View Source
var (
MaintainNotNeeded = errors.New("maintain not needed")
)
Functions ¶
Types ¶
type Boxer ¶
type Boxer struct {
// contains filtered or unexported fields
}
func NewBoxer ¶
func NewBoxer(options ...BoxerOptions) (*Boxer, error)
func (*Boxer) CloseInterval ¶
func (*Boxer) CloseIntervalScope ¶
func (*Boxer) ForEach ¶
func (b *Boxer) ForEach(interval int64, scope string, fn BoxerForEachFunc) error
func (*Boxer) GetAllIntervals ¶
func (*Boxer) GetClosedIntervals ¶
func (*Boxer) GetScopesForInterval ¶
type BoxerOptions ¶
type BoxerOptions interface {
// contains filtered or unexported methods
}
func WithBufferStorage ¶
func WithBufferStorage(buffer Buffer) BoxerOptions
func WithGrace ¶
func WithGrace(grace time.Duration) BoxerOptions
func WithInterval ¶
func WithInterval(interval time.Duration) BoxerOptions
func WithIntervalCount ¶
func WithIntervalCount(intervalCount int64) BoxerOptions
func WithTimeFunc ¶
func WithTimeFunc(timefunc TimeFunc) BoxerOptions
type Buffer ¶
type Buffer interface { Write(data *BufferRecord) error GetScopes(interval int64) (scopes []string, err error) GetIntervals() (intervals []int64, err error) ForEach(interval int64, scope string, f ForEachFunc) error CloseIntervalScope(interval int64, scope string) error CloseInterval(interval int64) error Shutdown() error }
type BufferRecord ¶
type FilesystemBuffer ¶
func NewFilesystemBuffer ¶
func NewFilesystemBuffer(directory string) *FilesystemBuffer
func (*FilesystemBuffer) CloseInterval ¶
func (b *FilesystemBuffer) CloseInterval(interval int64) error
func (*FilesystemBuffer) CloseIntervalScope ¶
func (b *FilesystemBuffer) CloseIntervalScope(interval int64, scope string) error
func (*FilesystemBuffer) ForEach ¶
func (b *FilesystemBuffer) ForEach(interval int64, scope string, fn ForEachFunc) error
func (*FilesystemBuffer) GetIntervals ¶
func (b *FilesystemBuffer) GetIntervals() (intervals []int64, err error)
func (*FilesystemBuffer) GetScopes ¶
func (b *FilesystemBuffer) GetScopes(interval int64) (scopes []string, err error)
func (*FilesystemBuffer) Shutdown ¶
func (b *FilesystemBuffer) Shutdown() error
func (*FilesystemBuffer) Write ¶
func (b *FilesystemBuffer) Write(data *BufferRecord) error
type ForEachFunc ¶
type ForEachFunc func(index, expected int, record *BufferRecord) (keepGoing bool, err error)
type MemoryBuffer ¶
func NewMemoryBuffer ¶
func NewMemoryBuffer() *MemoryBuffer
func (*MemoryBuffer) CloseInterval ¶
func (b *MemoryBuffer) CloseInterval(interval int64) error
func (*MemoryBuffer) CloseIntervalScope ¶
func (b *MemoryBuffer) CloseIntervalScope(interval int64, scope string) error
func (*MemoryBuffer) ForEach ¶
func (b *MemoryBuffer) ForEach(interval int64, scope string, fn ForEachFunc) error
func (*MemoryBuffer) GetIntervals ¶
func (b *MemoryBuffer) GetIntervals() (intervals []int64, err error)
func (*MemoryBuffer) GetScopes ¶
func (b *MemoryBuffer) GetScopes(interval int64) (scopes []string, err error)
func (*MemoryBuffer) Shutdown ¶
func (b *MemoryBuffer) Shutdown() error
func (*MemoryBuffer) Wipe ¶
func (b *MemoryBuffer) Wipe() error
func (*MemoryBuffer) Write ¶
func (b *MemoryBuffer) Write(data *BufferRecord) error
type MemoryItem ¶
type MemoryItem struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.