storage

package
v0.0.0-...-efd50ba Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CUser          *mongo.Collection
	CEntity        *mongo.Collection
	CEnvoyGotify   *mongo.Collection
	CEnvoyEmail    *mongo.Collection
	CEnvoyWebhook  *mongo.Collection
	CEnvoyTelegram *mongo.Collection
	CEnvoySMS      *mongo.Collection
	COfflineLog    *mongo.Collection
	CEnvoyLog      *mongo.Collection
	CUserLoginLog  *mongo.Collection
	CTLS           *mongo.Collection
)
View Source
var DeleteInfluxDB api.DeleteAPI
View Source
var QueryInfluxDB api.QueryAPI
View Source
var WriteInfluxDB api.WriteAPI
View Source
var WriteInfluxDBBlocking api.WriteAPIBlocking

Functions

func ConnectInfluxDB

func ConnectInfluxDB()

func ConnectMongo

func ConnectMongo()

func MongoUseSession

func MongoUseSession(ctx context.Context, f func(sessionContext mongo.SessionContext) error) error

func QuickRCSearch

func QuickRCSearch[T any](ctx context.Context, key string, fallback func() (T, error), exp ...time.Duration) (*T, error)

func Redis

func Redis() redis.UniversalClient

func Secret

func Secret(key string) string

Types

type ConfigInfo

type ConfigInfo struct {
	InfluxDBToken          string   `yaml:"influxdb_token"`
	InfluxDBURI            string   `yaml:"influxdb_uri"`
	InfluxDBOrg            string   `yaml:"influxdb_org"`
	InfluxDBDatabase       string   `yaml:"influxdb_database"`
	MongoDBURI             string   `yaml:"mongodb_uri"`
	TelegramBotToken       string   `yaml:"telegram_bot_token"`
	TelegramBotApiEndpoint string   `yaml:"telegram_bot_api_endpoint"`
	TelegramBotName        string   `yaml:"telegram_bot_name"`
	TencentSTMPPassword    string   `yaml:"tencent_smtp_password"`
	WebEndpoint            string   `yaml:"web_endpoint"`
	RedisAddrs             []string `yaml:"redis_addrs"`
	RedisUsername          string   `yaml:"redis_username"`
	RedisPassword          string   `yaml:"redis_password"`
}

func Config

func Config() *ConfigInfo

type FirebaseInterface

type FirebaseInterface interface {
	Config() map[string]interface{}
	ConfigGetString(key string) string
	App() *firebase.App
}

func Firebase

func Firebase() FirebaseInterface

Jump to

Keyboard shortcuts

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