readeef: github.com/urandom/readeef/config Index | Files

package config

import "github.com/urandom/readeef/config"

Index

Package Files

config.go default.go parts.go

Variables

var DefaultCfg = "" /* 1250 byte string literal not displayed */

DefaultCfg shows the default configuration of the readeef server

type API Uses

type API struct {
    Version   int      `toml:"version"`
    Emulators []string `toml:"emulators"`
    Limits    struct {
        ArticlesPerQuery int `toml:"articles-per-query"`
    }   `toml:"limits"`
}

func (*API) Convert Uses

func (c *API) Convert()

type Auth Uses

type Auth struct {
    Secret             string `toml:"secret"`
    SessionStoragePath string `toml:"session-storage-path"`
    TokenStoragePath   string `toml:"token-storage-path"`
}

type Config Uses

type Config struct {
    Server      Server      `toml:"server"`
    Log         Log         `toml:"log"`
    API         API         `toml:"api"`
    Timeout     Timeout     `toml:"timeout"`
    DB          DB          `toml:"db"`
    Auth        Auth        `toml:"auth"`
    Hubbub      Hubbub      `toml:"hubbub"`
    Popularity  Popularity  `toml:"popularity"`
    FeedParser  FeedParser  `toml:"feed-parser"`
    FeedManager FeedManager `toml:"feed-manager"`
    Content     Content     `toml:"content"`
    UI          UI          `toml:"ui"`
}

Config is the readeef configuration

func Read Uses

func Read(path string) (Config, error)

Read loads the config data from the given path

type Content Uses

type Content struct {
    ThumbnailGenerator string `toml:"thumbnail-generator"`

    Extract struct {
        Generator      string `toml:"generator"`
        ReadabilityKey string `toml:"readability-key"`
    }   `toml:"extract"`

    Search struct {
        Provider   string `toml:"provider"`
        BatchSize  int64  `toml:"batch-size"`
        BlevePath  string `toml:"bleve-path"`
        ElasticURL string `toml:"elastic-url"`
    }   `toml:"search"`

    Article struct {
        Processors           []string `toml:"processors"`
        ProxyHTTPURLTemplate string   `toml:"proxy-http-url-template"`
    }   `toml:"article"`
}

type DB Uses

type DB struct {
    Driver  string `toml:"driver"`
    Connect string `toml:"connect"`
}

type FeedManager Uses

type FeedManager struct {
    UpdateInterval string `toml:"update-interval"`

    Monitors []string `toml:"monitors"`

    Converted struct {
        UpdateInterval time.Duration
    }   `toml:"-"`
}

func (*FeedManager) Convert Uses

func (c *FeedManager) Convert()

type FeedParser Uses

type FeedParser struct {
    Processors []string `toml:"processors"`

    ProxyHTTPURLTemplate string `toml:"proxy-http-url-template"`
}

type Hubbub Uses

type Hubbub struct {
    CallbackURL string `toml:"callback-url"` // http://www.example.com
    From        string `toml:"from"`
}

type Log Uses

type Log struct {
    Level            string `toml:"level"`
    File             string `toml:"file"`
    AccessFile       string `toml:"access-file"`
    Formatter        string `toml:"formatter"`
    RepoCallDuration bool   `toml:"repo-call-duration"`

    Converted struct {
        Writer io.Writer
        Prefix string
    }   `toml:"-"`
}

func (*Log) Convert Uses

func (c *Log) Convert()

type Popularity Uses

type Popularity struct {
    Delay     string   `toml:"delay"`
    Providers []string `toml:"providers"`

    Twitter struct {
        ConsumerKey       string `toml:"consumer-key"`
        ConsumerSecret    string `toml:"consumer-secret"`
        AccessToken       string `toml:"access-token"`
        AccessTokenSecret string `toml:"access-token-secret"`
    }   `toml:"twitter"`

    Reddit struct {
        ID       string `toml:"id"`
        Secret   string `toml:"secret"`
        Username string `toml:"username"`
        Password string `toml:"password"`
    }   `toml:"reddit"`

    Converted struct {
        Delay time.Duration
    }   `toml:"-"`
}

func (*Popularity) Convert Uses

func (c *Popularity) Convert()

type Server Uses

type Server struct {
    Address  string `toml:"address"`
    Port     int    `toml:"port"`
    CertFile string `toml:"cert-file"`
    KeyFile  string `toml:"key-file"`

    AutoCert struct {
        Host        string `toml:"host"`
        StoragePath string `toml:"storage-path"`
    }   `toml:"auto-cert"`
}

type Timeout Uses

type Timeout struct {
    Connect   string `toml:"connect"`
    ReadWrite string `toml:"read-write"`

    Converted struct {
        Connect   time.Duration
        ReadWrite time.Duration
    }   `toml:"-"`
}

func (*Timeout) Convert Uses

func (c *Timeout) Convert()

type UI Uses

type UI struct {
    Path string `toml:"path"`
}

Package config imports 7 packages (graph) and is imported by 7 packages. Updated 2018-11-14. Refresh now. Tools for package owners.