Documentation ¶
Overview ¶
package for parsing config files
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = Config{ Store: &StoreConfig{ Path: "storage", }, NNTP: &NNTPServerConfig{ Bind: "127.0.0.1:1119", Name: "nntp.server.tld", Article: &ArticleConfig{ AllowGroups: []string{"ctl", "overchan.test"}, DisallowGroups: []string{"overchan.cp"}, ForceWhitelist: false, AllowAnon: true, AllowAttachments: true, AllowAnonAttachments: false, }, }, }
default configuration
Functions ¶
This section is empty.
Types ¶
type ArticleConfig ¶
type ArticleConfig struct { // explicitly allow these newsgroups AllowGroups []string // explicitly disallow these newsgroups DisallowGroups []string // only allow explicitly allowed groups ForceWhitelist bool // allow anonymous posts? AllowAnon bool // allow attachments? AllowAttachments bool // allow anonymous attachments? AllowAnonAttachments bool }
configration for local article policies
type Config ¶
type Config struct { // list of feeds to add on runtime Feeds []*FeedConfig `json:"feeds"` // nntp server configuration NNTP *NNTPServerConfig `json:"nntp"` // log level Log string `json:"log"` Store *StoreConfig `json:"storage"` // contains filtered or unexported fields }
main configuration
type FeedConfig ¶
type FeedConfig struct { // feed's policy, filters articles Policy *ArticleConfig `json:"policy"` // remote server's address Addr string `json:"addr"` // do we want to periodically pull from this server? PullSync bool `json:"pull_enabled"` // proxy server config Proxy *ProxyConfig `json:"proxy"` // nntp username to log in with Username string `json:"-"` // nntp password to use when logging in Password string `json:"-"` // do we want to use tls? TLS bool `json:"tls"` // the name of this feed Name string `json:"name"` // how often to pull articles from the server PullInterval time.Duration `json:"pull_interval"` }
configuration for 1 nntp feed
type NNTPServerConfig ¶
type NNTPServerConfig struct { // address to bind to Bind string // name of the nntp server Name string // default inbound article policy Article *ArticleConfig }
type ProxyConfig ¶
type StoreConfig ¶
type StoreConfig struct { // path to article directory Path string `json:"path"` }
Click to show internal directories.
Click to hide internal directories.