blog

package
v0.0.0-...-136e2db Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPostID

func GetPostID(now time.Time) string

func OpenOrCreate

func OpenOrCreate(filepath string) (*os.File, error)

func ReadString

func ReadString(filepath string) (string, error)

Types

type Blog

type Blog struct {
	// contains filtered or unexported fields
}

func Connect

func Connect(uri string) (*Blog, error)

func (*Blog) CreateNewPost

func (b *Blog) CreateNewPost(post Post) error

func (*Blog) DeletePostByID

func (b *Blog) DeletePostByID(id string) error

func (*Blog) GetAllPosts

func (b *Blog) GetAllPosts() ([]Post, error)

func (*Blog) GetPostByFilePath

func (b *Blog) GetPostByFilePath(filepath string) ([]Post, error)

func (*Blog) GetPostByID

func (b *Blog) GetPostByID(id string) ([]Post, error)

func (*Blog) Save

func (b *Blog) Save()

type EmptyResult

type EmptyResult struct {
}

func (*EmptyResult) LastInsertId

func (er *EmptyResult) LastInsertId() (int64, error)

func (*EmptyResult) RowsAffected

func (er *EmptyResult) RowsAffected() (int64, error)

type Post

type Post struct {
	ID       string `json:"ID"`
	Filepath string `json:"filepath"`
	Author   string `yaml:"Author" json:"Author"`
	Title    string `yaml:"Title" json:"Title"`
}

func LoadFromMarkdown

func LoadFromMarkdown(md string) (Post, error)

func LoadFromMarkdownFile

func LoadFromMarkdownFile(filepath string) (Post, error)

func (*Post) RenderHTML

func (post *Post) RenderHTML() string

Jump to

Keyboard shortcuts

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