Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config interface {
GetNNTPPool() (nntppool.UsenetConnectionPool, error)
GetPostingConfig() PostingConfig
GetPostCheckConfig() PostCheck
GetPar2Config(ctx context.Context) (*Par2Config, error)
GetWatcherConfig() WatcherConfig
}
type ConnectionPoolConfig ¶ added in v0.0.2
type CustomHeader ¶
type GroupPolicy ¶
type GroupPolicy string
const ( // ALL : everything is posted on ALL the Groups GroupPolicyAll GroupPolicy = "all" // EACH_FILE : each File will be posted on a random Group from the list (only with Article's obfuscation) GroupPolicyEachFile GroupPolicy = "each_file" )
type MessageIDFormat ¶
type MessageIDFormat string
const ( // NGX: the Message-ID will be formatted as https://github.com/javi11/nxg MessageIDFormatNGX MessageIDFormat = "ngx" // Random: the Message-ID will be a random string of 32 characters MessageIDFormatRandom MessageIDFormat = "random" )
type ObfuscationPolicy ¶
type ObfuscationPolicy string
const ( // Will do the following obfuscation: // - Subject: will be obfuscated // - Filename: will be obfuscated // - Yenc header filename: will be randomized for every article // - Date: will be randomized for every article within last 6 hours // - NGX-header: will not be added // - Poster: will be random for each article ObfuscationPolicyFull ObfuscationPolicy = "full" // Will do the following obfuscation: // - Subject: will be obfuscated // - Filename: will be obfuscated // - Yenc header filename: will be same one for all articles // - Date: will be the real posted date // - Poster: will be the same one for all articles ObfuscationPolicyPartial ObfuscationPolicy = "partial" // Nothing will be obfuscated ObfuscationPolicyNone ObfuscationPolicy = "none" )
type Par2Config ¶
type PostCheck ¶
type PostCheck struct {
// If enabled articles will be checked after being posted. Default value is `true`.
Enabled bool `yaml:"enabled"`
// Delay between retries. Default value is `10s`.
RetryDelay time.Duration `yaml:"delay"`
// The maximum number of re-posts if article check fails. Default value is `1`.
MaxRePost uint `yaml:"max_reposts"`
}
type PostHeaders ¶
type PostHeaders struct {
// Whether to add the X-NXG header to the uploaded articles (You will still see this header in the generated NZB). Default value is `true`.
// If obfuscation policy is `FULL` this header will not be added.
// If message_id_format is not `ngx` this header will not be added.
AddNGXHeader bool `yaml:"add_ngx_header"`
// The default from header for the uploaded articles. By default a random poster will be used for each article. This will override GenerateFromByArticle
DefaultFrom string `yaml:"default_from"`
// Add custom headers to the uploaded articles. Subject, From, Newsgroups, Message-ID and Date can not be override.
CustomHeaders []CustomHeader `yaml:"custom_headers"`
}
type PostingConfig ¶
type PostingConfig struct {
MaxRetries int `yaml:"max_retries"`
RetryDelay time.Duration `yaml:"retry_delay"`
ArticleSizeInBytes uint64 `yaml:"article_size_in_bytes"`
Groups []string `yaml:"groups"`
ThrottleRate int64 `yaml:"throttle_rate"` // bytes per second
MaxWorkers int `yaml:"max_workers"`
MessageIDFormat MessageIDFormat `yaml:"message_id_format"`
PostHeaders PostHeaders `yaml:"post_headers"`
// If true the uploaded subject and filename will be obfuscated. Default value is `true`.
ObfuscationPolicy ObfuscationPolicy `yaml:"obfuscation_policy"`
Par2ObfuscationPolicy ObfuscationPolicy `yaml:"par2_obfuscation_policy"`
// If you give several Groups you've 3 policy when posting
GroupPolicy GroupPolicy `yaml:"group_policy"`
}
PostingConfig represents posting configuration
type ScheduleConfig ¶ added in v0.0.2
type ServerConfig ¶
type ServerConfig struct {
Host string `yaml:"host"`
Port int `yaml:"port"`
Username string `yaml:"username"`
Password string `yaml:"password"`
SSL bool `yaml:"ssl"`
MaxConnections int `yaml:"max_connections"`
MaxConnectionIdleTimeInSeconds int `yaml:"max_connection_idle_time_in_seconds"`
MaxConnectionTTLInSeconds int `yaml:"max_connection_ttl_in_seconds"`
InsecureSSL bool `yaml:"insecure_ssl"`
}
ServerConfig represents a Usenet server configuration
type WatcherConfig ¶ added in v0.0.2
Click to show internal directories.
Click to hide internal directories.