Documentation
¶
Index ¶
- Variables
- func GetDefaultConfigDirectory(app string, filename string) string
- func Init(configFilePath string) error
- func InitializeTrackerStatuses(perTrackerOverrides map[string][]string)
- func ParseTrackerDomain(trackerHost string) string
- func ShowUsing()
- func ValidateStruct(s any) []error
- type Configuration
- type DefaultValidator
- type DiscordConfig
- type FilterConfiguration
- type NotificationService
- type NotificationsConfig
- type RequiredValidator
- type Torrent
- func (t *Torrent) HasAllTags(tags ...string) bool
- func (t *Torrent) HasAnyTag(tags ...string) bool
- func (t *Torrent) HasMissingFiles() bool
- func (t *Torrent) IsIntermediateStatus() bool
- func (t *Torrent) IsTrackerDown() bool
- func (t *Torrent) IsUnregistered(ctx context.Context) bool
- func (t *Torrent) Log(n float64) float64
- func (t *Torrent) RegexMatch(pattern string) bool
- func (t *Torrent) RegexMatchAll(patternsStr string) bool
- func (t *Torrent) RegexMatchAny(patternsStr string) bool
- func (t *Torrent) TagsSlice() []string
- type TorrentRegistrationState
- type TrackerErrorsConfig
- type Validator
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Delimiter = "." Config *Configuration K = koanf.New(Delimiter) )
Functions ¶
func InitializeTrackerStatuses ¶
InitializeTrackerStatuses prepares the default status map and processes per-tracker overrides. It should be called once after configuration is loaded.
func ParseTrackerDomain ¶ added in v1.16.0
func ValidateStruct ¶
Types ¶
type Configuration ¶
type Configuration struct {
Clients map[string]map[string]any
Filters map[string]FilterConfiguration
Trackers tracker.Config
BypassIgnoreIfUnregistered bool
TrackerErrors TrackerErrorsConfig `yaml:"tracker_errors" koanf:"tracker_errors"`
Notifications NotificationsConfig `yaml:"notifications" koanf:"notifications"`
}
type DefaultValidator ¶
type DefaultValidator struct {
}
type DiscordConfig ¶ added in v1.14.0
type FilterConfiguration ¶
type FilterConfiguration struct {
MapHardlinksFor []string
Ignore []string
Remove []string
Pause []string
DeleteData *bool
Orphan struct {
GracePeriod time.Duration `yaml:"grace_period" koanf:"grace_period"`
IgnorePaths []string `yaml:"ignore_paths" koanf:"ignore_paths"`
} `yaml:"orphan" koanf:"orphan"`
Label []struct {
Name string
Update []string
}
Tag []struct {
Name string
Mode string
UploadKb *int `mapstructure:"uploadKb"`
Update []string
}
}
type NotificationService ¶ added in v1.14.0
type NotificationService struct {
Discord DiscordConfig `yaml:"discord" koanf:"discord"`
}
type NotificationsConfig ¶ added in v1.14.0
type NotificationsConfig struct {
Detailed bool
SkipEmptyRun bool `yaml:"skip_empty_run" koanf:"skip_empty_run"`
Service NotificationService
}
type RequiredValidator ¶
type RequiredValidator struct {
}
type Torrent ¶
type Torrent struct {
// torrent
Hash string `json:"Hash"`
Name string `json:"Name"`
Path string `json:"Path"`
TotalBytes int64 `json:"TotalBytes"`
DownloadedBytes int64 `json:"DownloadedBytes"`
State string `json:"State"`
Files []string `json:"Files"`
Tags map[string]struct{} `json:"Tags"`
Downloaded bool `json:"Downloaded"`
Seeding bool `json:"Seeding"`
Ratio float32 `json:"Ratio"`
AddedSeconds int64 `json:"AddedSeconds"`
AddedHours float32 `json:"AddedHours"`
AddedDays float32 `json:"AddedDays"`
SeedingSeconds int64 `json:"SeedingSeconds"`
SeedingHours float32 `json:"SeedingHours"`
SeedingDays float32 `json:"SeedingDays"`
LastActivitySeconds int64 `json:"LastActivitySeconds"`
LastActivityHours float32 `json:"LastActivityHours"`
LastActivityDays float32 `json:"LastActivityDays"`
Label string `json:"Label"`
Seeds int64 `json:"Seeds"`
Peers int64 `json:"Peers"`
IsPrivate bool `json:"IsPrivate"`
IsPublic bool `json:"IsPublic"`
UpLimit int64 `json:"UpLimit,omitempty"`
// set by client on GetCurrentFreeSpace
FreeSpaceGB func() float64 `json:"-"`
FreeSpaceSet bool `json:"-"`
// tracker
TrackerName string `json:"TrackerName"`
TrackerStatus string `json:"TrackerStatus"`
// AllTrackerStatuses stores status messages from all trackers (key: tracker URL, value: status message)
AllTrackerStatuses map[string]string `json:"AllTrackerStatuses,omitempty"`
Comment string `json:"Comment"`
RegistrationState TorrentRegistrationState `json:"-"`
// set by command
HardlinkedOutsideClient bool `json:"-"`
APIDividerPrinted bool `json:"-"`
// contains filtered or unexported fields
}
func (*Torrent) HasAllTags ¶
func (*Torrent) HasMissingFiles ¶
func (*Torrent) IsIntermediateStatus ¶ added in v1.15.0
func (*Torrent) IsTrackerDown ¶
func (*Torrent) RegexMatch ¶
RegexMatch delegates to the regex checker
func (*Torrent) RegexMatchAll ¶
RegexMatchAll checks if the torrent name matches all the provided patterns
func (*Torrent) RegexMatchAny ¶
RegexMatchAny checks if the torrent name matches any of the provided patterns
type TorrentRegistrationState ¶ added in v1.15.0
type TorrentRegistrationState uint8
const ( NoRegistrationState TorrentRegistrationState = iota UnregisteredState RegisteredState IntermediateState )
type TrackerErrorsConfig ¶
type TrackerErrorsConfig struct {
// PerTrackerUnregisteredStatuses allows overriding the default list of unregistered statuses
// on a per-tracker basis. The key is the tracker name (case-insensitive),
// and the value is a list of status strings (case-insensitive, exact match).
PerTrackerUnregisteredStatuses map[string][]string `yaml:"per_tracker_unregistered_statuses" koanf:"per_tracker_unregistered_statuses"`
}
Click to show internal directories.
Click to hide internal directories.