config

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2020 License: GPL-3.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	SLOT_IA = "ia"
	SLOT_IS = "is"
	SLOT_IP = "ip"
)

Variables

This section is empty.

Functions

func SlotName

func SlotName(s string) string

SlotName returns the descriptions of the wayback service.

Types

type Options

type Options struct {
	// contains filtered or unexported fields
}
var Opts *Options

Opts holds parsed configuration options.

func NewOptions

func NewOptions() *Options

NewOptions returns Options with default values.

func (*Options) HasDebugMode

func (o *Options) HasDebugMode() bool

HasDebugMode returns true if debug mode is enabled.

func (*Options) IPFSHost

func (o *Options) IPFSHost() string

IPFSHost returns the host of IPFS daemon service.

func (*Options) IPFSMode

func (o *Options) IPFSMode() string

IPFSMode returns the mode to using IPFS.

func (*Options) IPFSPort

func (o *Options) IPFSPort() uint

IPFSPort returns the port of IPFS daemon service.

func (*Options) LogTime

func (o *Options) LogTime() bool

LogTime returns if the time should be displayed in log messages.

func (*Options) Slots

func (o *Options) Slots() map[string]bool

Slots returns configurations of wayback service, e.g. Internet Archive

func (*Options) TelegramChannel

func (o *Options) TelegramChannel() string

TelegramChannel returns the Telegram Channel name.

func (*Options) TelegramToken

func (o *Options) TelegramToken() string

TelegramToken returns the token of Telegram Bot.

func (*Options) TorLocalPort

func (o *Options) TorLocalPort() int

TorLocalPort returns the local port to a TCP listener on.

func (*Options) TorPrivKey

func (o *Options) TorPrivKey() string

TorPrivKey returns the private key of Tor service.

func (*Options) TorRemotePorts

func (o *Options) TorRemotePorts() []int

TorRemotePorts returns the remote ports to serve the Tor hidden service on.

func (*Options) UseTor

func (o *Options) UseTor() bool

UseTor returns whether to use the Tor proxy when snapshot webpage.

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser handles configuration parsing.

func NewParser

func NewParser() *Parser

NewParser returns a new Parser.

func (*Parser) ParseEnvironmentVariables

func (p *Parser) ParseEnvironmentVariables() (*Options, error)

ParseEnvironmentVariables loads configuration values from environment variables.

Jump to

Keyboard shortcuts

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