Documentation
¶
Index ¶
- type Database
- type SqlDatabase
- func (db SqlDatabase) AddPage(title string, content string, link string) (int, error)
- func (db SqlDatabase) AddPermalink(permalink common.Permalink) (int, error)
- func (db SqlDatabase) AddPost(title string, excerpt string, content string) (int, error)
- func (db SqlDatabase) ChangePost(id int, title string, excerpt string, content string) error
- func (db SqlDatabase) DeletePost(id int) (int, error)
- func (db SqlDatabase) GetPage(link string) (common.Page, error)
- func (db SqlDatabase) GetPermalinks() ([]common.Permalink, error)
- func (db SqlDatabase) GetPost(post_id int) (post common.Post, err error)
- func (db SqlDatabase) GetPosts(limit int, offset int) (all_posts []common.Post, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database interface {
GetPosts(int, int) ([]common.Post, error)
GetPost(post_id int) (common.Post, error)
AddPost(title string, excerpt string, content string) (int, error)
ChangePost(id int, title string, excerpt string, content string) error
DeletePost(id int) (int, error)
AddPage(title string, content string, link string) (int, error)
GetPage(link string) (common.Page, error)
AddPermalink(permalink common.Permalink) (int, error)
GetPermalinks() ([]common.Permalink, error)
}
type SqlDatabase ¶
func MakeMysqlConnection ¶
func MakeSqliteConnection ¶
func MakeSqliteConnection(databaseFile string) (SqlDatabase, error)
func (SqlDatabase) AddPermalink ¶
func (db SqlDatabase) AddPermalink(permalink common.Permalink) (int, error)
func (SqlDatabase) ChangePost ¶
/ This function changes a post based on the values / provided. Note that empty strings will mean that / the value will not be updated.
func (SqlDatabase) DeletePost ¶
func (db SqlDatabase) DeletePost(id int) (int, error)
/ This function changes a post based on the values / provided. Note that empty strings will mean that / the value will not be updated.
func (SqlDatabase) GetPermalinks ¶
func (db SqlDatabase) GetPermalinks() ([]common.Permalink, error)
Click to show internal directories.
Click to hide internal directories.