Documentation
¶
Index ¶
- Constants
- Variables
- func ArticlesPage(c *gin.Context)
- func Atom(c *gin.Context)
- func BeginLogin(c *gin.Context)
- func BeginRegister(c *gin.Context)
- func BitcoinAliases(c *gin.Context)
- func DeleteArticle(c *gin.Context)
- func DeleteOption(c *gin.Context)
- func Feed(c *gin.Context)
- func FinishLogin(c *gin.Context)
- func FinishRegister(c *gin.Context)
- func GetArticle(c *gin.Context)
- func GetOption(c *gin.Context)
- func GwtWhoisInfo(c *gin.Context)
- func HomePage(c *gin.Context)
- func InsertArticle(c *gin.Context)
- func InsertOption(c *gin.Context)
- func ListArticles(c *gin.Context)
- func ListOptions(c *gin.Context)
- func LoginPage(c *gin.Context)
- func Mdcat(c *gin.Context)
- func MetaWeblog(c *gin.Context)
- func PrometheusMetrics(c *gin.Context)
- func RSS(c *gin.Context)
- func Redirect(routePath string) func(*gin.Context)
- func RegisterPage(c *gin.Context)
- func UpdateArticle(c *gin.Context)
- func UpdateOption(c *gin.Context)
- func UploadFileForUPic(c *gin.Context)
- func WebAuthnWellKnown(c *gin.Context)
- func WebDAV(c *gin.Context)
- type FinishLoginRequest
- type FinishRegisterRequest
Constants ¶
const (
DefaultPageLimit int = 8
)
DefaultPageLimit is default limit number per page, and other constant.
Variables ¶
var WebdavMethods = []string{
"OPTIONS", "GET", "HEAD", "POST", "DELETE", "PUT",
"MKCOL", "COPY", "MOVE", "LOCK", "UNLOCK", "PROPFIND", "PROPPATCH",
}
WebdavMethods is a list of supported WebDAV methods.
Functions ¶
func ArticlesPage ¶
ArticlesPage returns JSON information by page number. Request sample:
GET => /page/1?limit=6
func BeginLogin ¶ added in v0.0.1
BeginLogin returns login webauthn creation and session.
func BeginRegister ¶ added in v0.0.1
BeginRegister returns register webauthn creation.
func BitcoinAliases ¶ added in v0.0.2
BitcoinAliases returns the Bitcoin BIP15 alias for specified user. Note: The status of standard BIP15 aliases is deferred.
Any => /bitcoin-alias/?handle=fengyj
func DeleteOption ¶
DeleteOption deletes option by 'name' param. Request sample:
DELETE => /option/:name
func FinishLogin ¶ added in v0.0.1
FinishLogin validates login webauthn credential.
func FinishRegister ¶ added in v0.0.1
FinishRegister validates register webauthn credential.
func GetArticle ¶
GetArticle gets an article by 'slug' param. Request sample:
GET => /article/article-custom-slug-path
func GwtWhoisInfo ¶ added in v0.0.1
GwtWhoisInfo gets domain whois information. Request sample:
GET => /whois?domain=xn--02f.com
func InsertArticle ¶
InsertArticle inserts an article. Request sample:
POST => /article?title=foo&status=1&content=bar
func ListArticles ¶
ListArticles returns the number of all articles. Request sample:
GET => /articles
func MetaWeblog ¶ added in v0.0.1
MetaWeblog is the controller of MetaWeblog API. The MetaWeblog API (MWA) is a programming interface that allows external programs to get and set the text and attributes of weblog posts.
More info to http://xmlrpc.com/storyreader/story2198.md and https://codex.wordpress.org/XML-RPC_MetaWeblog_API
func PrometheusMetrics ¶ added in v0.1.1
PrometheusMetrics serves Prometheus metrics.
func RegisterPage ¶ added in v0.0.1
RegisterPage returns register html page.
func UploadFileForUPic ¶ added in v0.0.1
UploadFileForUPic uploads files to the specified file path. Request sample:
POST => /upload/upic?file=...
func WebAuthnWellKnown ¶ added in v0.0.2
WebAuthnWellKnown returns well-known json for webauthn. The `origins` field is relate with the WebAuthn config.
Types ¶
type FinishLoginRequest ¶ added in v0.0.1
type FinishLoginRequest struct { Username string `json:"username"` Credential json.RawMessage `json:"credential"` Session json.RawMessage `json:"session"` }
FinishRegisterRequest is request body for finish register.
type FinishRegisterRequest ¶ added in v0.0.1
type FinishRegisterRequest struct { Username string `json:"username"` Credential json.RawMessage `json:"credential"` }
FinishRegisterRequest is request body for finish register.