config

package
v0.0.0-...-5085e7c Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TumblrDomainToName

func TumblrDomainToName(domain string) string

func TumblrNameToDomain

func TumblrNameToDomain(name string) string

Types

type BlogConfig

type BlogConfig struct {
	// Required
	Name   string `toml:"name"`
	Target string `toml:"target"`

	// Optional
	AllowReblogsFrom *[]string `toml:"allow_reblogs_from"`
	Before           time.Time `toml:"before,omitempty"`
	Rescrape         bool      `toml:"rescrape,omitempty"`
}

type BlogList

type BlogList []*BlogConfig

func (BlogList) Len

func (s BlogList) Len() int

func (BlogList) Less

func (s BlogList) Less(i, j int) bool

func (BlogList) Swap

func (s BlogList) Swap(i, j int)

type Config

type Config struct {
	// Required
	APIKey string   `toml:"api_key"`
	Blogs  BlogList `toml:"blogs"`

	// Optional
	Concurrency int    `toml:"concurrency"`
	Username    string `toml:"username"`
	Password    string `toml:"password"`
}

func LoadConfigOrDefault

func LoadConfigOrDefault(path string) (*Config, error)

func (*Config) Save

func (s *Config) Save(path string)

Jump to

Keyboard shortcuts

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