config

package
v0.0.0-...-5edc56a Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MediaMusic = "music"
	MediaVideo = "video"
)

Variables

View Source
var (
	ErrTestConfig   = errors.New("missing test config")
	ErrInvalidCache = errors.New("invalid cache entry")
)

Functions

func AddConfigPath

func AddConfigPath(path string)

func SetConfigFile

func SetConfigFile(path string)

func SetConfigName

func SetConfigName(name string)

Types

type ActivityConfig

type ActivityConfig struct {
	DB                 DatabaseConfig
	ActivityLimit      int
	RecentLimit        int
	PopularLimit       int
	RecentMoviesTitle  string
	RecentTracksTitle  string
	PopularMoviesTitle string
	PopularTracksTitle string
}

type AssistantConfig

type AssistantConfig struct {
	ProjectID       string
	TrackLimit      int
	RecentLimit     int
	Welcome         AssistantResponse
	Play            AssistantResponse
	Error           AssistantResponse
	Link            AssistantResponse
	Linked          AssistantResponse
	Guest           AssistantResponse
	Recent          AssistantResponse
	Release         AssistantResponse
	SuggestionAuth  string
	SuggestionNew   string
	MediaObjectName Template
	MediaObjectDesc Template
}

type AssistantResponse

type AssistantResponse struct {
	Speech Template
	Text   Template
}

type AuthConfig

type AuthConfig struct {
	DB            DatabaseConfig
	SessionAge    time.Duration
	CodeAge       time.Duration
	SecureCookies bool
	AccessToken   TokenConfig
	MediaToken    TokenConfig
	CodeToken     TokenConfig
}

type BucketConfig

type BucketConfig struct {
	Endpoint        string
	Region          string
	AccessKeyID     string
	SecretAccessKey string
	BucketName      string
	ObjectPrefix    string
	UseSSL          bool
	URLExpiration   time.Duration
	Media           string
	RewriteRules    []RewriteRule
}

type ClientConfig

type ClientConfig struct {
	CacheDir  string
	MaxAge    time.Duration
	UseCache  bool
	UserAgent string
}

func (*ClientConfig) Merge

func (c *ClientConfig) Merge(o ClientConfig)

type Config

type Config struct {
	Auth      AuthConfig
	Buckets   []BucketConfig
	Client    ClientConfig
	Fanart    FanartAPIConfig
	LastFM    LastFMAPIConfig
	Music     MusicConfig
	TMDB      TMDBAPIConfig
	Search    SearchConfig
	Server    ServerConfig
	Video     VideoConfig
	Assistant AssistantConfig
	Podcast   PodcastConfig
	Progress  ProgressConfig
	Activity  ActivityConfig
}

func GetConfig

func GetConfig() (*Config, error)

GetConfig uses viper loads the default configuration.

func LoadConfig

func LoadConfig(dir string) (*Config, error)

LoadConfig uses viper to load a config file in the provided directory. The result is returned as a Config and cached.

func TestConfig

func TestConfig() (*Config, error)

type DatabaseConfig

type DatabaseConfig struct {
	Driver string
	Source string
	Logger string
}

func (DatabaseConfig) GormConfig

func (c DatabaseConfig) GormConfig() *gorm.Config

type DateRecommend

type DateRecommend struct {
	Name   string
	Layout string
	Match  string
	Query  string
}

type FanartAPIConfig

type FanartAPIConfig struct {
	ProjectKey  string
	PersonalKey string
}

type LastFMAPIConfig

type LastFMAPIConfig struct {
	Key    string
	Secret string
}

type MusicConfig

type MusicConfig struct {
	ArtistFile           string
	ArtistRadioBreadth   int
	ArtistRadioDepth     int
	DB                   DatabaseConfig
	DeepLimit            int
	PopularLimit         int
	RadioGenres          []string
	RadioLimit           int
	RadioOther           map[string]string
	RadioSearchLimit     int
	RadioSeries          []string
	RadioStreams         []RadioStream
	Recent               time.Duration
	RecentLimit          int
	ReleaseCountries     []string
	SearchLimit          int
	SimilarArtistsLimit  int
	SimilarReleases      time.Duration
	SimilarReleasesLimit int
	SinglesLimit         int

	SyncInterval        time.Duration
	PopularSyncInterval time.Duration
	SimilarSyncInterval time.Duration
	CoverSyncInterval   time.Duration
	// contains filtered or unexported fields
}

func (*MusicConfig) UserArtistID

func (mc *MusicConfig) UserArtistID(name string) (string, bool)

type PodcastConfig

type PodcastConfig struct {
	DB           DatabaseConfig
	Series       []string
	Client       ClientConfig
	RecentLimit  int
	EpisodeLimit int
	SyncInterval time.Duration
	SearchLimit  int
}

type ProgressConfig

type ProgressConfig struct {
	DB DatabaseConfig
}

type RadioStream

type RadioStream struct {
	Creator  string
	Title    string
	Image    string
	Location string
}

type RecommendConfig

type RecommendConfig struct {
	When []DateRecommend
}

type RewriteRule

type RewriteRule struct {
	Pattern string
	Replace string
}

type SearchConfig

type SearchConfig struct {
	BleveDir string
}

type ServerConfig

type ServerConfig struct {
	Listen      string
	DataDir     string
	MediaDir    string
	ImageClient ClientConfig
}

type SetlistAPIConfig

type SetlistAPIConfig struct {
	ApiKey string
}

type TMDBAPIConfig

type TMDBAPIConfig struct {
	Key          string
	Language     string
	FileTemplate Template
}

type Template

type Template struct {
	Text string
	// contains filtered or unexported fields
}

func (*Template) Execute

func (t *Template) Execute(vars interface{}) string

func (*Template) Template

func (t *Template) Template() *template.Template

type TokenConfig

type TokenConfig struct {
	Issuer     string
	Age        time.Duration
	Secret     string
	SecretFile string
}

type VideoConfig

type VideoConfig struct {
	DB                   DatabaseConfig
	ReleaseCountries     []string
	CastLimit            int
	CrewJobs             []string
	Recent               time.Duration
	RecentLimit          int
	SearchLimit          int
	Recommend            RecommendConfig
	SyncInterval         time.Duration
	PosterSyncInterval   time.Duration
	BackdropSyncInterval time.Duration
}

Jump to

Keyboard shortcuts

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