routes

package
v4.0.0-...-755bc99 Latest Latest
Warning

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

Go to latest
Published: May 26, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentInfo

type AgentInfo struct {
	Platform  string `json:"platform"`
	UserAgent string `json:"user_agent"`
}

type LoginReq

type LoginReq struct {
	AgentInfo AgentInfo `json:"agent_info"`
	Name      string    `json:"name"`
	Passwd    string    `json:"passwd"`
}

func (*LoginReq) Bind

func (r *LoginReq) Bind(c *gin.Context) mir.Error

Bind custom binding but not effect because defined in sampe package with servant interface

type LoginResp

type LoginResp struct {
	UserInfo
	ServerInfo ServerInfo `json:"server_info"`
	JwtToken   string     `json:"jwt_token"`
}

func (*LoginResp) Render

func (r *LoginResp) Render(c *gin.Context)

Bind custom render but not effect because defined in sampe package with servant interface

type LogoutReq

type LogoutReq struct {
	AgentInfo AgentInfo `json:"agent_info"`
	Name      string    `json:"name"`
}

type ServerInfo

type ServerInfo struct {
	ApiVer string `json:"api_ver"`
}

type Site

type Site struct {
	Chain            `mir:"-"`
	Index            func(Get, Chain)                               `mir:"/index/"`
	Articles         func(Get)                                      `mir:"/articles/:category/"`
	AnyTopics        func()                                         `mir:"/topics/"`
	NextTweets       func(Any, TweetsReq) TweetsResp                `mir:"/tweets/next/" binding:"json"`
	PrevTweets       func(Post, Get, Head, TweetsReq) TweetsResp    `mir:"/tweets/prev/" render:"json"`
	Login            func(Post, LoginReq) LoginResp                 `mir:"/user/login/"`
	Logout           func(Post, LogoutReq)                          `mir:"/user/logout/"`
	ImageUpload      func(Post, Context)                            `mir:"/upload/image/:name/"`
	FileUpload       func(Post, Chain, Context)                     `mir:"/upload/file/:name/"`
	SimpleUpload     func(Post, Chain, Context, LoginReq) LoginResp `mir:"/upload/simple/:name/"`
	Assets           func(Get, Context, LoginReq)                   `mir:"/assets/:name/"`
	Statics          func(Get, Context)                             `mir:"/statics/:name/"`
	AnyStaticks      func(Any, Context)                             `mir:"/anystaticks/:name/"`
	ManyResources    func(Get, Head, Options, Context)              `mir:"/resources/:name/"`
	MultiAttachments func(Get, Head, Options, Chain, Context)       `mir:"/attachments/:name/"`
}

Site site interface info

type Tweet

type Tweet struct {
	Type    string `json:"type"`
	Content string `json:"content"`
}

type TweetsReq

type TweetsReq struct {
	Date string `json:"date"`
}

type TweetsResp

type TweetsResp struct {
	Tweets []Tweet `json:"tweets"`
	Total  uint32  `json:"total"`
}

type UserInfo

type UserInfo struct {
	Name string `json:"name"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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