controller

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: Zlib Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPageLimit int = 8
)

DefaultPageLimit is default limit number per page, and other constant.

Variables

View Source
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

func ArticlesPage(c *gin.Context)

ArticlesPage returns JSON information by page number. Request sample:

GET => /page/1?limit=6

func Atom

func Atom(c *gin.Context)

func BeginLogin

func BeginLogin(c *gin.Context)

BeginLogin returns login webauthn creation and session.

func BeginRegister

func BeginRegister(c *gin.Context)

BeginRegister returns register webauthn creation.

func BitcoinAliases

func BitcoinAliases(c *gin.Context)

BitcoinAliases returns the Bitcoin BIP15 alias for specified user. Note: The status of standard BIP15 aliases is deferred.

Any => /bitcoin-alias/?handle=fengyj

func DeleteArticle

func DeleteArticle(c *gin.Context)

DeleteArticle deletes an article.

func DeleteOption

func DeleteOption(c *gin.Context)

DeleteOption deletes option by 'name' param. Request sample:

DELETE => /option/:name

func Feed

func Feed(c *gin.Context)

func FinishLogin

func FinishLogin(c *gin.Context)

FinishLogin validates login webauthn credential.

func FinishRegister

func FinishRegister(c *gin.Context)

FinishRegister validates register webauthn credential.

func GetArticle

func GetArticle(c *gin.Context)

GetArticle gets an article by 'slug' param. Request sample:

GET => /article/article-custom-slug-path

func GetOption

func GetOption(c *gin.Context)

GetOption returns an option by 'name' param. Request sample:

GET => /option/:name

func GwtWhoisInfo

func GwtWhoisInfo(c *gin.Context)

GwtWhoisInfo gets domain whois information. Request sample:

GET => /whois?domain=xn--02f.com

func HomePage

func HomePage(c *gin.Context)

HomePage returns home and index page. Request sample:

GET => /
GET => /page/1

func InsertArticle

func InsertArticle(c *gin.Context)

InsertArticle inserts an article. Request sample:

POST => /article?title=foo&status=1&content=bar

func InsertOption

func InsertOption(c *gin.Context)

InsertOption inserts an option. Request sample:

POST => /option

func ListArticles

func ListArticles(c *gin.Context)

ListArticles returns the number of all articles. Request sample:

GET => /articles

func ListOptions

func ListOptions(c *gin.Context)

ListOptions returns all options. Request sample:

GET => /options

func LoginPage

func LoginPage(c *gin.Context)

LoginPage returns login html page.

func Mdcat

func Mdcat(c *gin.Context)

Mdcat renders the markdown page to HTML.

func MetaWeblog

func MetaWeblog(c *gin.Context)

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 OAuth2Callback

func OAuth2Callback(c *gin.Context)

OAuth2Callback handles the OAuth2 callback from the provider.

func OAuth2Redirect

func OAuth2Redirect(c *gin.Context)

OAuth2Redirect handles OAuth2 redirection to the provider's authorization page.

func PrometheusMetrics

func PrometheusMetrics(c *gin.Context)

PrometheusMetrics serves Prometheus metrics.

func RSS

func RSS(c *gin.Context)

func Redirect

func Redirect(routePath string) func(*gin.Context)

Redirect returns a HTTP redirect to the specific route path.

func RegisterPage

func RegisterPage(c *gin.Context)

RegisterPage returns register html page.

func UpdateArticle

func UpdateArticle(c *gin.Context)

UpdateArticle updates an article.

func UpdateOption

func UpdateOption(c *gin.Context)

UpdateOption updates an option. Request sample:

PUT => /option/:name

func UploadFileForUPic

func UploadFileForUPic(c *gin.Context)

UploadFileForUPic uploads files to the specified file path. Request sample:

POST => /upload/upic?file=...

func WebAuthnWellKnown

func WebAuthnWellKnown(c *gin.Context)

WebAuthnWellKnown returns well-known json for webauthn. The `origins` field is relate with the WebAuthn config.

func WebDAV

func WebDAV(c *gin.Context)

Types

type FinishLoginRequest

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

type FinishRegisterRequest struct {
	Username   string          `json:"username"`
	Credential json.RawMessage `json:"credential"`
}

FinishRegisterRequest is request body for finish register.

Jump to

Keyboard shortcuts

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