BlogggerBot package - github.com/mehdy/BlogggerBot - Go Packages

BlogggerBot

package module
v0.0.0-...-c3ca2ae Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2017 License: GPL-3.0 Imports: 3 Imported by: 0

README

Bloggger Bot

This is the bot that sends blog updates to Bloggger channel

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blog

type Blog struct {
	gorm.Model
	Title         string    `gorm:"SIZE:512;NOT NULL"`
	Description   string    `gorm:"SIZE:2048"`
	URL           string    `gorm:"SIZE:1024;NOT NULL"`
	FeedURL       string    `gorm:"SIZE:1024;NOT NULL"`
	Language      string    `gorm:"SIZE:5"`
	LastUpdatedAt time.Time `gorm:"NOT NULL"`
	Posts         []Post    `gorm:"ForeignKey:BlogID"`
}

type BlogService

type BlogService interface {
	GetBlog(uint) (Blog, error)
	GetBlogs() ([]Blog, error)
	CreateBlog(*Blog) error
	UpdatedBlog(*Blog) error
	CreatePost(*Post) error
	GetNewPosts() ([]Post, error)
	Notify(*Post) error
}

type FeedService

type FeedService interface {
	GetNewPosts(url string, since time.Time) ([]gofeed.Item, error)
	GetBlog(url string) (gofeed.Feed, error)
}

type Post

type Post struct {
	gorm.Model
	BlogID      uint `gorm:"NOT NULL"`
	Blog        Blog
	Author      string    `gorm:"SIZE:256;NOT NULL"`
	Title       string    `gorm:"SIZE:2048;NOT NULL"`
	Content     string    `gorm:"NOT NULL"`
	PublishedAt time.Time `gorm:"NOT NULL"`
	URL         string    `gorm:"NOT NULL"`
	ShortURL    string
	GUID        string `gorm:"NOT NULL;UNIQUE"`
	Notified    bool   `gorm:"NOT NULL;DEFAULT:false"`
}

Directories

Path Synopsis
cmd
BlogggerBot command

Jump to

Keyboard shortcuts

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