app

package
v0.0.0-...-f2b64ca Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2021 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DB        dbConfig
	Telegram  bot.Config
	Template  string
	Log       logConfig
	BuntDB    buntDBConfig
	Telegraph telegraphConfig
}

Config is the configuration used in viper

var DefaultConfig Config = Config{
	DB:       dbConfig{Type: "sqlite", Path: "portier.db", Username: "portier", Password: "portier", Host: "localhost", Port: 3306, DBName: "portier"},
	Telegram: bot.Config{Token: ""},
	Template: "",
	Log:      logConfig{Mode: "", Path: ""},
	BuntDB:   buntDBConfig{Path: "feed.db"},
	Telegraph: telegraphConfig{
		Account:   1,
		ShortName: "Portier",
		Author:    "Portier",
		AuthorURL: "https://github.com/TechMinerApps/portier",
	},
}

DefaultConfig is the default config of Portier

type Portier

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

Portier is the main app

func NewPortier

func NewPortier() *Portier

NewPortier create a new portier object does not need config as parameter since this is the main object

func (*Portier) DB

func (p *Portier) DB() *gorm.DB

DB returns the database instance portier used

func (*Portier) Logger

func (p *Portier) Logger() log.Logger

Logger returns the logger portier used

func (*Portier) Poller

func (p *Portier) Poller() feed.Poller

Poller return the poller portier used

func (*Portier) Start

func (p *Portier) Start()

Start is used to start portier instance do not return error since error handling show be done within portier object

func (*Portier) Stop

func (p *Portier) Stop(sig ...os.Signal)

Stop shutdown portier gracefully can accept a list of signals, print them if provided

func (*Portier) Wait

func (p *Portier) Wait()

Wait is a blocking function that wait for portier to stop

Jump to

Keyboard shortcuts

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