double_buffer

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDoubleBufferLogNil      = errors.New("double_buffer log nil")
	ErrDoubleBufferReloaderNil = errors.New("double_buffer Reloader nil")

	DefaultRelaodTime = time.Minute * 1
)

Functions

This section is empty.

Types

type DoubleBufLog

type DoubleBufLog interface {
	Debugf(f string, args ...interface{})
	Infof(f string, args ...interface{})
	Warnf(f string, args ...interface{})
	Errorf(f string, args ...interface{})
}

type DoubleBuffer

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

func NewDoubleBuffer

func NewDoubleBuffer(ctx context.Context, opts DoubleBufferOpts) (*DoubleBuffer, error)

func (*DoubleBuffer) Close

func (d *DoubleBuffer) Close()

func (*DoubleBuffer) GetBuf

func (d *DoubleBuffer) GetBuf() interface{}

type DoubleBufferOpts

type DoubleBufferOpts struct {
	Reloader   Reloader
	RelaodTime time.Duration
	Log        DoubleBufLog
}

type Reloader

type Reloader interface {
	ReloadBuf(ctx context.Context) (interface{}, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL