lib

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 3, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func NewTextGenerator

func NewTextGenerator() text.Generator

Types

type Cache

type Cache struct {
	Connection *redis.Pool
}

func (Cache) Delete

func (c Cache) Delete(key string) (bool, error)

Delete delete a key

func (Cache) Exists

func (c Cache) Exists(key string) (bool, error)

Get gets a key

func (Cache) Save

func (c Cache) Save(key string) error

Set a key/value

type Database

type Database struct {
	DB *gorm.DB
}

func NewDatabase

func NewDatabase(env Env) Database

type Env

type Env struct {
	ServerPort    string
	LogOutput     string
	DBUsername    string
	DBPassword    string
	DBHost        string
	DBPort        string
	DBName        string
	CacheHost     string
	CachePort     string
	CachePassword string
	ApiKey        string
	ApiRate       int
}

func NewEnv

func NewEnv() Env

func (*Env) LoadEnv

func (env *Env) LoadEnv()

type ICache

type ICache interface {
	Save(string) error
	Exists(string) (bool, error)
	Delete(string) (bool, error)
}

func NewCache

func NewCache(env Env) ICache

type RequestHandler

type RequestHandler struct {
	Gin *gin.Engine
}

func NewRequestHandler

func NewRequestHandler() RequestHandler

Jump to

Keyboard shortcuts

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