posts

package
v3.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DBPostsSchema = `` /* 416-byte string literal not displayed */

)

Variables

View Source
var (
	ErrDoesNotExist  = errors.New("does not exist")
	ErrAlreadyExists = errors.New("already exists")
)
View Source
var DB = db.DB

Functions

This section is empty.

Types

type Post

type Post struct {
	PostID          int64         `josn:"id" db:"post_id"`
	Title           string        `json:"title"`
	PostDescription string        `json:"description" db:"post_description"`
	Link            string        `json:"link"`
	Updated         time.Time     `json:"updated"`
	Published       time.Time     `json:"published"`
	Author          string        `json:"author"`
	Content         string        `json:"content"`
	Tags            string        `json:"tags"`
	ShortID         string        `json:"short_id" db:"short_id"`
	JsonData        types.JsonMap `json:"data" db:"json_data"`

	feeds.Feed
}

func GetPostsByFeedId

func GetPostsByFeedId(feedId int64) ([]*Post, error)

func ListPosts

func ListPosts() ([]Post, error)

func (*Post) Write

func (post *Post) Write(feedId int64) error

Auto generates shortId

func (*Post) WriteWithShortId

func (post *Post) WriteWithShortId(feedId int64, shortId interface{}) error

Writes with provided short id

Jump to

Keyboard shortcuts

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