postgres

package
v0.0.0-...-13e6371 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

func NewCache

func NewCache(connStr string, cacheSize int, translators []string) (*Cache, error)

func (*Cache) Close

func (c *Cache) Close() error

func (*Cache) Get

func (c *Cache) Get(bucketName, text string) (string, bool, error)

func (*Cache) Put

func (c *Cache) Put(bucketName, text, translation string, cerr error) error

type Item

type Item struct {
	Translation string
	ErrorCode   translationError
	ErrorText   string
	Timestamp   int64
}

type Translation

type Translation struct {
	Service     string `gorm:"primaryKey"`
	Text        string `gorm:"primarykey"`
	Translation string
	ErrorCode   translationError
	ErrorText   string
	Timestamp   time.Time
}

Jump to

Keyboard shortcuts

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