cache

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const PriorityLangDefault = "default"

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache it is a module context structure

func Init

func Init(s Settings) (Cache, error)

Init settings up Cache

func (*Cache) Close

func (c *Cache) Close() error

Close closes cache endpoints

func (*Cache) PrioritiesGet

func (c *Cache) PrioritiesGet() ([]Priority, error)

func (*Cache) PrioritiesGetLocale added in v1.4.0

func (c *Cache) PrioritiesGetLocale(lang string) ([]PriorityLocale, error)

func (*Cache) PriorityGetByID

func (c *Cache) PriorityGetByID(id int64) (Priority, error)

PriorityGetByID gets priority by specified ID from cache (Redmine)

func (*Cache) PriorityGetByIDLocale added in v1.4.0

func (c *Cache) PriorityGetByIDLocale(id int64, lang string) (PriorityLocale, error)

func (*Cache) PriorityGetDefault

func (c *Cache) PriorityGetDefault() (Priority, error)

PriorityGetDefault gets default priority from cache (Redmine)

func (*Cache) PriorityGetDefaultLocale added in v1.4.0

func (c *Cache) PriorityGetDefaultLocale(lang string) (PriorityLocale, error)

func (*Cache) ProjectsFilterActive

func (c *Cache) ProjectsFilterActive(projects []misc.IDName) ([]misc.IDName, error)

func (*Cache) Update

func (c *Cache) Update() error

Update updates cache

func (*Cache) UserGet

func (c *Cache) UserGet(id int64) (redis.User, error)

UserGet gets user ID by username from cache (Redmine)

type Priority

type Priority struct {
	ID        int64
	Name      map[string]string
	IsDefault bool
}

func (Priority) NameLocale added in v1.4.0

func (p Priority) NameLocale(lang string) string

type PriorityLocale added in v1.4.0

type PriorityLocale struct {
	ID        int64
	Name      string
	IsDefault bool
}

type Project

type Project struct {
	ID       int64
	Name     string
	Trackers []misc.IDName
}

type Settings

type Settings struct {
	Redmine   redmine.Redmine
	RedisHost string
}

Settings contains settings for cache

Jump to

Keyboard shortcuts

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