config

package
v0.0.0-...-2ff8efa Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "dev"

Functions

This section is empty.

Types

type Config

type Config struct {
	Server   ServerConfig
	Log      LoggingConfig
	JWT      JWTConfig
	DB       DBConfig
	TG       TGConfig
	CronJobs CronJobConfig
	Cache    struct {
		MaxSize   int
		RedisAddr string
		RedisPass string
	}
}

type CronJobConfig

type CronJobConfig struct {
	Enable               bool
	CleanFilesInterval   time.Duration
	CleanUploadsInterval time.Duration
	FolderSizeInterval   time.Duration
}

type DBConfig

type DBConfig struct {
	DataSource  string
	PrepareStmt bool
	LogLevel    int
	Pool        struct {
		Enable             bool
		MaxOpenConnections int
		MaxIdleConnections int
		MaxLifetime        time.Duration
	}
}

type JWTConfig

type JWTConfig struct {
	Secret       string
	SessionTime  time.Duration
	AllowedUsers []string
}

type LoggingConfig

type LoggingConfig struct {
	Level       int
	Development bool
	File        string
}

type ServerConfig

type ServerConfig struct {
	Port             int
	GracefulShutdown time.Duration
	EnablePprof      bool
	ReadTimeout      time.Duration
	WriteTimeout     time.Duration
}

type TGConfig

type TGConfig struct {
	AppId               int
	AppHash             string
	RateLimit           bool
	RateBurst           int
	Rate                int
	DeviceModel         string
	SystemVersion       string
	AppVersion          string
	LangCode            string
	SystemLangCode      string
	LangPack            string
	SessionFile         string
	DisableStreamBots   bool
	BgBotsCheckInterval time.Duration
	Proxy               string
	ReconnectTimeout    time.Duration
	PoolSize            int64
	EnableLogging       bool
	Uploads             struct {
		EncryptionKey string
		Threads       int
		MaxRetries    int
		Retention     time.Duration
	}
	Stream struct {
		MultiThreads int
		Buffers      int
		ChunkTimeout time.Duration
	}
}

Jump to

Keyboard shortcuts

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