reflection

package
v0.14.4 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager represents an object for managing and scheduling published data upload to reflectors.

func NewManager

func NewManager(blobsPath string, reflector string) *Manager

NewManager returns a Manager instance. To initialize a returned instance (connect to the reflector DB), call Initialize() on it.

func (*Manager) Abort

func (r *Manager) Abort()

Abort resets the upload schedule and cancels blob upload after the currently uploading blob is finished.

func (*Manager) Initialize

func (r *Manager) Initialize()

Initialize connects to the reflector database

func (*Manager) IsInitialized

func (r *Manager) IsInitialized() bool

IsInitialized returns true whenever Manager object is ready to use.

func (*Manager) ReflectAll

func (r *Manager) ReflectAll() (*RunStats, error)

ReflectAll uploads and then deletes all blobs in the blob directory.

func (*Manager) Start

func (r *Manager) Start(interval time.Duration)

Start launches blob upload procedure at specified intervals. If upload duration at the end exceeds specified interval, it will just start the upload again after it's done.

type ReflError

type ReflError struct {
	FilePath string
	Error    error
}

ReflError contains a blob file name and an error

type RunStats

type RunStats struct {
	sync.RWMutex
	TotalBlobs     int
	ReflectedBlobs int
	Errors         []ReflError
}

RunStats contains stats of blob reflection run, typically a result of ReflectAll call

Jump to

Keyboard shortcuts

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