type User struct {
ID int64 `json:"id"`
Name string `json:"name" form:"name"`
Password string `json:"password,omitempty" form:"password" sql:"-"`
Recovery string `json:"-"`
Digest []byte `json:"-"`
Email string `json:"email,omitempty" form:"email" binding:"required" sql:"unique"`
Posts []Post `json:"posts"`
}
Displays all users and their data
Displays data of a single user.
Creates a new user. Required parameters are email and password.
{
"name": "Juuso",
"password": "foo",
"email": "foo@example.com"
}
Logins a user and if successful, returns session cookie. Required parameters are email and password.
{
"email": "foo@example.com",
"password": "foo",
}
Logs out and deletes the current session.
type Post struct {
ID int64 `json:"id"`
Title string `json:"title" form:"title" binding:"required"`
Content string `json:"content" form:"content" sql:"type:text"`
Markdown string `json:"markdown" form:"markdown" sql:"type:text"`
Date int64 `json:"date"`
Slug string `json:"slug"`
Author int64 `json:"author"`
Excerpt string `json:"excerpt"`
Viewcount uint `json:"viewcount"`
Published bool `json:"-"`
}
Displays all posts
Displays a single post
Creates a new post. Requires active session. Example payload:
{
"title": "My first post",
"content": "This is my first post!"
}
Publishes a post. Requires active session. Requires post slug as parameter.
Updates a post. Requires active session. Required parameters are slug, content and title.
{
"slug": "my-first-post",
"title": "My first post edited",
"content": "This is my first post, edited."
}
Deletes a post. Requires active session. Requires post slug as parameter.
type Search struct {
Query string `json:"query" form:"query" binding:"required"`
Score float64
Posts []Post
}
Uses site's search to find posts with given query. Example payload:
{
"query": "first"
}
type Vertigo struct {
Name string `json:"name" form:"name" binding:"required"`
Hostname string `json:"hostname" form:"hostname" binding:"required"`
URL url.URL `json:"-,omitempty"`
Firstrun bool `json:"firstrun,omitempty"`
CookieHash string `json:"cookiehash,omitempty"`
AllowRegistrations bool `json:"allowregistrations" form:"allowregistrations"`
Description string `json:"description" form:"description" binding:"required"`
Mailer SMTP `json:"smtp"`
}
Displays settings given in installation wizard. Requires active session cookie.
Updates the settings with given data. Requires active session cookie.
{
"hostname": "example.com",
"name": "Foo Blog",
"description": "Foo's test blog",
"mailgun": {
"mgdomain": "foo",
"mgprikey": "foo"
}
}