article

package
v0.0.0-...-a70d403 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(db *sql.DB)

func Delete

func Delete(db *sql.DB, Url string) (bool, error)

func Insert

func Insert(db *sql.DB, A Article) error

func SelectTags

func SelectTags(db *sql.DB, IsPublic bool) ([][]string, error)

func SelectsLength

func SelectsLength(db *sql.DB, c Condition, IsPublic bool) (int, error)

func Update

func Update(db *sql.DB, A Article, url string) error

func UpdateReadNum

func UpdateReadNum(db *sql.DB, readNum int64, id int) error

Types

type Article

type Article struct {
	Id          int
	Author      string
	Create_time time.Time
	Modify_time time.Time
	Url         string
	Site        string
	Read_num    int64
	Like_num    int64
	Tags        []string
	Is_public   bool
	Logo_url    string
	Summary     string
	Toc         []string
	Title       string
	Content     string
	Html        string
	Comment     []string
}

func Select

func Select(db *sql.DB, Url string, IsPublic bool) (Article, error)

func SelectById

func SelectById(db *sql.DB, Id string, IsPublic bool) (Article, error)

func Selects

func Selects(db *sql.DB, c Condition, IsPublic bool) ([]Article, error)

func SelectsByIds

func SelectsByIds(db *sql.DB, as []string, IsPublic bool) ([]Article, error)

func (Article) String

func (a Article) String() string

type Condition

type Condition struct {
	Limit          string
	Offset         string
	Sort           string
	SortType       string
	Tag            []string
	AmbiguousTitle string
}

func (*Condition) Init

func (c *Condition) Init(e *gin.Context)

func (Condition) String

func (c Condition) String() string

type Tags

type Tags struct {
	Tags []string
}

Jump to

Keyboard shortcuts

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