utils

package
v0.0.0-...-1d971ed Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func CreateConnectionDB

func CreateConnectionDB(database string)

func CreateMessage

func CreateMessage(post *models.Post) string

func InsertPost

func InsertPost(post *models.Post)

func IsNewPost

func IsNewPost(post *models.Post) bool

func SendTelegramMessage

func SendTelegramMessage(message string, config Config, post *models.Post) bool

Types

type Config

type Config struct {
	DBConnection    string
	DBTable         string
	ScrapeUrlList   []string
	TelegramApiKey  string
	TelegramChannel string
	Sentry          string
}

func ReadConfig

func ReadConfig() Config

type Message

type Message struct {
	ChatId string `json:"chat_id"`
	Text   string `json:"text"`
}

Jump to

Keyboard shortcuts

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