config

package
v0.1.0-nightly Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationConfig

type ApplicationConfig struct {
	PublicURL  string   `mapstructure:"public_url"`
	Port       int      `mapstructure:"port"`
	SourceID   string   `mapstructure:"source_id"`
	SourceName string   `mapstructure:"source_name"`
	MediaTypes []string `mapstructure:"media_types"`
}

type AuthConfig

type AuthConfig struct {
	JWTSigningMethod           string        `mapstructure:"jwt_signing_method"`
	JWTSigningKey              string        `mapstructure:"jwt_signing_key"`
	JWTRefreshTokenExpiration  time.Duration `mapstructure:"jwt_refresh_token_expiration"`
	JWTAccessTokenExpiration   time.Duration `mapstructure:"jwt_access_token_expiration"`
	GlobalAPIRoutesRequireAuth bool          `mapstructure:"global_api_routes_require_auth"`
	UserAPIRoutesRequireAuth   bool          `mapstructure:"user_api_routes_require_auth"`
	UserAPIRequireSameUseUser  bool          `mapstructure:"user_api_require_same_user"`
}

type Config

type Config struct {
	Application   ApplicationConfig   `mapstructure:"application"`
	Auth          AuthConfig          `mapstructure:"auth"`
	General       GeneralConfig       `mapstructure:"general"`
	SourceScripts SourceScriptsConfig `mapstructure:"source_scripts"`
	Logs          LogsConfig          `mapstructure:"logs"`
	Storage       StorageConfig       `mapstructure:"storage"`
	Database      DatabaseConfig      `mapstructure:"database"`
}
var Conf Config

func LoadConfig

func LoadConfig() (Config, error)

type DatabaseConfig

type DatabaseConfig struct {
	Engine     string                   `mapstructure:"engine"`
	SQLite     SQLiteDatabaseConfig     `mapstructure:"sqlite"`
	PostgreSQL PostgreSQLDatabaseConfig `mapstructure:"postgresql"`
}

type GeneralConfig

type GeneralConfig struct {
	IDLength                  int                               `mapstructure:"id_length"`
	IncludeVideoResults       bool                              `mapstructure:"include_video_results"`
	VideoAudioOnly            bool                              `mapstructure:"video_audio_only"`
	InheritListenCounts       bool                              `mapstructure:"inherit_listen_counts"`
	ArtistListenCountsByTrack bool                              `mapstructure:"artist_listen_counts_by_track"`
	UserArtistLinking         bool                              `mapstructure:"user_artist_linking"`
	MaxSearchResults          int                               `mapstructure:"max_search_results"`
	MaxTrackDuration          time.Duration                     `mapstructure:"max_track_duration"`
	ReservedUsernames         []string                          `mapstructure:"reserved_usernames"`
	CustomDisplayNames        bool                              `mapstructure:"custom_display_names"`
	ReserveDisplayNames       bool                              `mapstructure:"reserve_display_names"`
	AdminPermissions          map[string]types.AdminPermissions `mapstructure:"admin_permissions"`
	EnabledSources            []string                          `mapstructure:"enabled_sources"`
}

type LogsConfig

type LogsConfig struct {
	LogLevel  log.Level `mapstructure:"log_level"`
	LogFormat string    `mapstructure:"log_format"`
}

type PostgreSQLDatabaseConfig

type PostgreSQLDatabaseConfig struct {
	Host   string `mapstructure:"host"`
	Port   int    `mapstructure:"port"`
	User   string `mapstructure:"user"`
	Pass   string `mapstructure:"pass"`
	DBName string `mapstructure:"db_name"`
	Params string `mapstructure:"params"`
}

type SQLiteDatabaseConfig

type SQLiteDatabaseConfig struct {
	Path string `mapstructure:"path"`
}

type SourceScriptsConfig

type SourceScriptsConfig struct {
	PythonCommand   string `mapstructure:"python_command"`
	YouTubeLocation string `mapstructure:"youtube_location"`
}

type StorageConfig

type StorageConfig struct {
	Location            string            `mapstructure:"location"`
	SizeLimit           datasize.ByteSize `mapstructure:"size_limit"`
	MinimumAgeThreshold time.Duration     `mapstructure:"minimum_age_threshold"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳