queue

package
v0.0.0-...-701d15c Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2019 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoFile         = errors.New("file does not exist")
	ErrNoDir          = errors.New("directory does not exist")
	ErrNoPermission   = errors.New("no permissions to access file or directory")
	ErrDunno          = errors.New("I seriously do not know what just happened")
	ErrNoDictionaries = errors.New("dictionaries are not supported")
	ErrDirIsFile      = errors.New("directory is file")
	ErrNotOpened      = errors.New("could not open file or directory")
)

Functions

This section is empty.

Types

type ActiveRunner

type ActiveRunner struct {
	sync.Mutex
	Channel  chan struct{}
	Waiter   sync.WaitGroup
	FileList *FileList
	Running  bool
	Paused   bool
}

func NewRunner

func NewRunner(fileList *FileList) *ActiveRunner

type FileList

type FileList struct {
	Files       []SingleFile `json:"files"`
	CurrentFile int          `json:"currentFile"`
	TotalFiles  int          `json:"totalFiles"`
}

func BuildFromDirectory

func BuildFromDirectory(inputDirectory string) (*FileList, error)

func BuildFromFileList

func BuildFromFileList(inputFiles []string) (*FileList, error)

func (*FileList) Append

func (fl *FileList) Append(a *FileList)

func (*FileList) CurrentOrFirst

func (fl *FileList) CurrentOrFirst() SingleFile

func (*FileList) GetNextFile

func (fl *FileList) GetNextFile() (*SingleFile, error)

func (*FileList) HasNextFile

func (fl *FileList) HasNextFile() bool

type SingleFile

type SingleFile struct {
	ReprenstativeName string `json:"representativeName"`
	FullPath          string `json:"fullPath"`
	ReadingPosition   int    `json:"readingPosition"`
	TotalLines        int    `json:"totalLines"`
}

Jump to

Keyboard shortcuts

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