configmodels

package
v0.0.0-...-3f23c4f Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultProviderConfig = ProviderConfig{
	Timeout: (30 * time.Second),
	RateLimit: ProviderRateLimit{
		Limit:  0,
		Period: 0,
	},
	Retry: ProviderRetry{
		Count:    1,
		Duration: 0,
	},
}

Functions

This section is empty.

Types

type APIServiceClient

type APIServiceClient struct {
	ImageProcessor configmodels.GRPCClient `json:"imageProcessor" mapstructure:"image_processor"`
}

func (*APIServiceClient) Validate

func (c *APIServiceClient) Validate() (err error)

type CronExpressions

type CronExpressions struct {
	RefreshProviders map[enum.AnimeProvider]string `json:"refreshProviders" mapstructure:"refresh_providers"`
}

func (*CronExpressions) Validate

func (c *CronExpressions) Validate() (err error)

type CronServiceClient

type CronServiceClient struct {
	AnimeAggregatorAdmin configmodels.GRPCClient `json:"animeAggregatorAdmin" mapstructure:"anime_aggregator_admin"`
}

func (*CronServiceClient) Validate

func (c *CronServiceClient) Validate() error

type Memory

type Memory struct {
	NumberOfCounters int64 `json:"numberOfCounters,omitempty" mapstructure:"number_of_counters"`
	MaximumCost      int64 `json:"maximumCost,omitempty" mapstructure:"maximum_cost"`
	BufferItems      int64 `json:"bufferItems,omitempty" mapstructure:"buffer_items"`
}

func (*Memory) Validate

func (m *Memory) Validate() (err error)

type ProviderConfig

type ProviderConfig struct {
	Timeout   time.Duration     `json:"timeout,omitempty" mapstructure:"timeout,omitempty"`
	RateLimit ProviderRateLimit `json:"rate_limit,omitempty" mapstructure:"rate_limit,omitempty"`
	Retry     ProviderRetry     `json:"retry,omitempty" mapstructure:"retry,omitempty"`
}

func (*ProviderConfig) Validate

func (p *ProviderConfig) Validate() (err error)

type ProviderRateLimit

type ProviderRateLimit struct {
	Period time.Duration `json:"period,omitempty" mapstructure:"period,omitempty"`
	Limit  int64         `json:"limit,omitempty" mapstructure:"limit,omitempty"`
}

func (ProviderRateLimit) String

func (p ProviderRateLimit) String() string

func (ProviderRateLimit) Validate

func (p ProviderRateLimit) Validate() (err error)

type ProviderRetry

type ProviderRetry struct {
	Count    int           `json:"count,omitempty" mapstructure:"count,omitempty"`
	Duration time.Duration `json:"duration,omitempty" mapstructure:"duration,omitempty"`
}

func (ProviderRetry) Validate

func (p ProviderRetry) Validate() (err error)

type Providers

type Providers map[enum.AnimeProvider]ProviderConfig

func (Providers) GetOrDefault

func (p Providers) GetOrDefault(provider enum.AnimeProvider) ProviderConfig

func (Providers) Validate

func (p Providers) Validate() (err error)

type RedisKeyTTL

type RedisKeyTTL struct {
	ProviderMappingGroups time.Duration `json:"providerMappingGroups" mapstructure:"provider_mapping_groups"`
	ProviderTags          time.Duration `json:"providerTags" mapstructure:"provider_tags"`
	ProviderGenres        time.Duration `json:"providerGenres" mapstructure:"provider_genres"`
	ProviderStudios       time.Duration `json:"providerStudios" mapstructure:"provider_studios"`
	ProviderMedias        time.Duration `json:"providerMedias" mapstructure:"provider_medias"`
	ProviderETag          time.Duration `json:"providerETag" mapstructure:"provider_etag"`

	AggregatedTitles      time.Duration `json:"aggregatedTitles" mapstructure:"aggregated_titles"`
	AggregatedAnimes      time.Duration `json:"aggregatedAnimes" mapstructure:"aggregated_animes"`
	AggregatedTags        time.Duration `json:"aggregatedTags" mapstructure:"aggregated_tags"`
	AggregatedGenres      time.Duration `json:"aggregatedGenres" mapstructure:"aggregated_genres"`
	AggregatedStudios     time.Duration `json:"aggregatedStudios" mapstructure:"aggregated_studios"`
	AggregatedSeasons     time.Duration `json:"aggregatedSeasons" mapstructure:"aggregated_seasons"`
	AggregatedSeasonYears time.Duration `json:"aggregatedSeasonYears" mapstructure:"aggregated_season_years"`
}

func (*RedisKeyTTL) Validate

func (c *RedisKeyTTL) Validate() (err error)

type TypesenseIndex

type TypesenseIndex struct {
	Address    string `json:"address,omitempty" mapstructure:"address,omitempty"`
	Collection string `json:"collection,omitempty" mapstructure:"collection,omitempty"`
	APIKey     string `json:"api_key,omitempty" mapstructure:"api_key,omitempty"`
}

func (*TypesenseIndex) Validate

func (t *TypesenseIndex) Validate() (err error)

Jump to

Keyboard shortcuts

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