model

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BlogDB mongo.DB
)

Functions

func Initialize

func Initialize(ctx context.Context)

Types

type Category

type Category struct {
	ID   bson.ObjectId `bson:"_id,omitempty" json:"mongo_id"`
	Name string        `bson:"name" json:"name"`
	URL  string        `bson:"url" json:"url"`
}

Category blog post categories

type Post

type Post struct {
	ID         bson.ObjectId `bson:"_id,omitempty" json:"mongo_id"`
	CreatedAt  time.Time     `bson:"post_created_at" json:"created_at"`
	ModifiedAt time.Time     `bson:"post_modified_gmt" json:"modified_at"`
	Title      string        `bson:"post_title" json:"title"`
	Type       string        `bson:"post_type" json:"type"`
	Status     string        `bson:"post_status" json:"status"`
	Name       string        `bson:"post_name" json:"name"`
	Content    string        `bson:"post_content" json:"content"`
	Markdown   string        `bson:"post_markdown" json:"markdown"`
	Author     bson.ObjectId `bson:"post_author" json:"author"`
	Menu       string        `bson:"post_menu" json:"menu"`
	Password   string        `bson:"post_password" json:"password"`
	Category   bson.ObjectId `bson:"category,omitempty" json:"category"`
	Tags       []string      `bson:"post_tags" json:"tags"`
	Hidden     bool          `bson:"hidden" json:"hidden"`
}

Post blog posts

type PostSeries

type PostSeries struct {
	ID     bson.ObjectId   `bson:"_id,omitempty" json:"mongo_id"`
	Key    string          `bson:"key" json:"key"`
	Remark string          `bson:"remark" json:"remark"`
	Posts  []bson.ObjectId `bson:"posts" json:"posts"`
	// Chidlren child series
	Chidlren []bson.ObjectId `bson:"children" json:"children"`
}

PostSeries blog post series

type User

type User struct {
	ID       bson.ObjectId `bson:"_id,omitempty" json:"mongo_id"`
	Username string        `bson:"username" json:"username"`
	Account  string        `bson:"account" json:"account"`
	Password string        `bson:"password" json:"password"`
}

User blog users

func (*User) GetID

func (u *User) GetID() string

func (*User) GetPayload

func (u *User) GetPayload() map[string]interface{}

Jump to

Keyboard shortcuts

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