persistance

package
v0.0.0-...-f72604a Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2018 License: GPL-3.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

View Source
const Filekey = "file:"

Filekey defines the key in the datastore for files

View Source
const TaskAliasMaster = ":masteralias"
View Source
const TaskAliasWorker = ":workeralias"
View Source
const TaskDelay = ":delay"
View Source
const TaskFileId = ":fileId"
View Source
const TaskMaster = ":master"
View Source
const TaskStatus = ":status"
View Source
const TaskWorker = ":worker"

Variables

This section is empty.

Functions

func UID

func UID() int64

UID generates a timestamp to uint64

Types

type Persistance

type Persistance struct {
	DB            *buntdb.DB
	GlusterPath   string
	DiscoveryHost string
}

Persistance contains all relevant data to the Framework datastore

func InitPersistance

func InitPersistance(path string, glusterPath string, discoveryHost string) (*Persistance, error)

InitPersistance initializes and loads the K/V datastore

func (*Persistance) ClosePersistance

func (persistance *Persistance) ClosePersistance()

ClosePersistance closes the Persistance Datastore

func (*Persistance) IndexTask

func (p *Persistance) IndexTask()

IndexTask set the Index in the Task K/V storage

func (*Persistance) ReadAllFiles

func (p *Persistance) ReadAllFiles() (*map[string]string, error)

func (*Persistance) ReadFilePath

func (p *Persistance) ReadFilePath(fileID string) (string, error)

ReadFilePath reads the Path of a given file in the datastore

func (*Persistance) ReadTask

func (p *Persistance) ReadTask(taskId string) (*app.AtqTaskFull, error)

func (*Persistance) StoreFile

func (p *Persistance) StoreFile(fileID, path string) error

StoreFile stores a file and its path in the Datastore

func (*Persistance) StoreTask

func (p *Persistance) StoreTask(alias string, fileID *string, delay int) error

StoreTask stores a Task in the Datastore

func (*Persistance) StoreTaskMaster

func (p *Persistance) StoreTaskMaster(taskId, serviceID, alias string) error

StoreTaskMaster persists the Master service ID inside taskId properties

func (*Persistance) StoreTaskWorker

func (p *Persistance) StoreTaskWorker(taskId, serviceID, alias string) error

StoreTaskWorker persists the Master service ID inside taskId properties

Jump to

Keyboard shortcuts

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