Documentation ¶
Index ¶
- type Admin
- type App
- type Loader
- type Post
- type PostService
- func (s *PostService) Get(id int) (*Post, error)
- func (s *PostService) GetSlug(slug string) (*Post, error)
- func (s *PostService) Insert(p *Post) error
- func (s *PostService) InsertArchive(p *Post) error
- func (s *PostService) Save(p *Post) error
- func (s *PostService) Select(where string, args ...interface{}) ([]*Post, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Admin ¶
type Admin struct { BaseURL string // contains filtered or unexported fields }
func NewBlogAdmin ¶
type App ¶
type App struct { BaseURL string FeedRSSURL string FeedAtomURL string PageSize int // contains filtered or unexported fields }
func (*App) GetAdmin ¶
Return an Admin object that can render admin homepage panels and register all of the administrative pages.
func (*App) WithBaseURL ¶
type Post ¶
type Post struct { ID uint64 Title string Slug string Content string ContentRendered string `db:"content_rendered"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` PublishedAt time.Time `db:"published_at"` Published int Tags []string `db:"-"` // contains filtered or unexported fields }
A Post is an entry in a blog
type PostService ¶
type PostService struct {
// contains filtered or unexported fields
}
func NewPostService ¶
func NewPostService(db db.DB) *PostService
NewPostService returns a cursor for Posts.
func (*PostService) GetSlug ¶
func (s *PostService) GetSlug(slug string) (*Post, error)
GetSlug gets a post by its slug.
func (*PostService) Insert ¶
func (s *PostService) Insert(p *Post) error
Insert p into the database db. If successful, p.ID will be set to the auto incremented ID provided by the database.
func (*PostService) InsertArchive ¶
func (s *PostService) InsertArchive(p *Post) error
InsertArchive inserts a post as an archival post, skipping the pre-save
func (*PostService) Save ¶
func (s *PostService) Save(p *Post) error
Save p to the database. If p's ID is 0, it is created with a new ID, otherwise it is updated. Even if the insertion or the update is a failure, preSave routines that modify p will run.
Click to show internal directories.
Click to hide internal directories.