userdb

package
v0.0.0-...-3298358 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FormatsNone uint8 = 0
	FormatsPNG  uint8 = 1
	FormatsJPG  uint8 = 2
	FormatsGIF  uint8 = 4
)

Variables

This section is empty.

Functions

func DBConfig

func DBConfig(dbType string, dbURL string)

func DBGetFormats

func DBGetFormats(id int64) []string

func DBGetLanguage

func DBGetLanguage(id int64) string

func DBParseFormatCode

func DBParseFormatCode(formatCode uint8) []string

func DBSaveFormatCode

func DBSaveFormatCode(id int64, formatCode uint8)

func DBSaveLanguage

func DBSaveLanguage(id int64, language string)

Types

type Cache

type Cache[T key] struct {
	// contains filtered or unexported fields
}

func NewCache

func NewCache[T key](tick time.Duration, autoUpdateExpiration bool) *Cache[T]

func (*Cache[T]) Delete

func (c *Cache[T]) Delete(key T)

func (*Cache[T]) Get

func (c *Cache[T]) Get(key T) (interface{}, bool)

func (*Cache[T]) Set

func (c *Cache[T]) Set(key T, value interface{}, expiration time.Duration)

type User

type User struct {
	gorm.Model
	ID         uint
	TelegramId int64 `gorm:"uniqueIndex"`
	Language   string
	FormatCode uint8
}

Jump to

Keyboard shortcuts

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