taskdb

package
v0.0.0-...-3270118 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheRecord

type CacheRecord struct {
	CurrWait    float32 `json:"curr_wait"`
	TaskID      string  `json:"task_id"`
	Created     int     `json:"created"`
	LastUpdate  int64   `json:"last_upd"`
	PID         int     `json:"pid"`
	RelConcSize float32 `json:"relconcsize"`
	ARF         float32 `json:"arf"`
	FullSize    int     `json:"fullsize"`
	Finished    bool    `json:"finished"`
	Error       string  `json:"error"`
	ConcSize    int     `json:"concsize"`
}

CacheRecord describes KonText's Redis cache record.

func (*CacheRecord) String

func (c *CacheRecord) String() string

type ConcCacheDB

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

ConcCacheDB is a simple wrapper around Redis connection with interface customized/stripped to our needs.

func NewConcCacheDB

func NewConcCacheDB(conf *ConcCacheDBConf) *ConcCacheDB

NewConcCacheDB creates a properly configured instance of ConcCacheDB

func (*ConcCacheDB) GetItem

func (c *ConcCacheDB) GetItem(corpusID string, cacheKey string) (*CacheRecord, error)

GetItem returns a cache item of a specific corpus and key.

type ConcCacheDBConf

type ConcCacheDBConf struct {
	Address  string `json:"address"`
	Database int    `json:"database"`
}

ConcCacheDBConf specifies a configuration of a connection to a Redis database containing KonText cache records.

Jump to

Keyboard shortcuts

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