Documentation
¶
Index ¶
- Variables
- func Get(db *badger.DB, key string) []byte
- func GetRaw(db *badger.DB, key []byte) []byte
- func OpenDB(customPath string, dbPath string) *badger.DB
- func Set(db *badger.DB, key string, value []byte)
- func SetWithTTL(db *badger.DB, key string, value []byte, ttl time.Duration)
- type Config
- type Data
- func (d *Data) DeleteVar(projectName, key string)
- func (d *Data) GetLog(key string) []byte
- func (d *Data) GetLogRaw(key []byte) []byte
- func (d *Data) GetVar(projectName, key string) []byte
- func (d *Data) InternalAlert(message string)
- func (d *Data) NewIssue(projectID, env, service, timestamp, key, flag string)
- func (d *Data) ProjectAlert(project, message string)
- func (d *Data) SetLog(key string, obj interface{}, ttl time.Duration)
- func (d *Data) SetVar(projectName, key string, obj interface{}, ttl time.Duration)
- func (d *Data) VarExists(projectName, key string) bool
- type InternalConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var IChatState = "IChatState"
Functions ¶
Types ¶
type Data ¶
type Data struct {
Log *zap.Logger
Chat *tb.Chat
DB *badger.DB
Config *Config
MediaPath string
R *sqlx.DB
Cache caching.Cache
}
func (*Data) InternalAlert ¶
func (*Data) ProjectAlert ¶
type InternalConfig ¶
type InternalConfig struct {
TG struct {
BotToken string `yaml:"bot_token"`
BossChatID int64 `yaml:"boss_chat_id"`
} `yaml:"tg"`
JWTExpHours int `yaml:"jwt_exp_hours"`
Log struct {
ClearOnRestart bool `yaml:"clear_on_restart"`
ServiceHostname string `yaml:"service_hostname"`
RetentionHours int `yaml:"retention_hours"`
SimilarityThreshold float64 `yaml:"similarity_threshold"`
} `yaml:"log"`
}
func ReadInternalConfig ¶
func ReadInternalConfig(path string) (InternalConfig, error)
Click to show internal directories.
Click to hide internal directories.