config

package
v0.0.0-...-95c851e Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2024 License: LGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultCfg = `` /* 1264-byte string literal not displayed */

DefaultCfg shows the default configuration of the readeef server

Functions

This section is empty.

Types

type API

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

func (*API) Convert

func (c *API) Convert()

type Auth

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

type Config

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

func Read(path string) (Config, error)

Read loads the config data from the given path

type Content

type Content struct {
	Thumbnail struct {
		Generator string `toml:"generator"`
		Store     bool   `toml:"store"`
	} `toml:"thumbnail"`

	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"`

	// deprecated
	ThumbnailGenerator string `toml:"thumbnail-generator"`
}

func (*Content) Convert

func (c *Content) Convert()

type DB

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

type FeedManager

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

	Monitors []string `toml:"monitors"`

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

func (*FeedManager) Convert

func (c *FeedManager) Convert()

type FeedParser

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

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

type Hubbub

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

type Log

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

func (c *Log) Convert()

type Popularity

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

func (c *Popularity) Convert()

type Server

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

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

type Timeout

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

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

func (*Timeout) Convert

func (c *Timeout) Convert()

type UI

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

Jump to

Keyboard shortcuts

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