Documentation ¶
Index ¶
- Constants
- type Actions
- func (actions *Actions) AuthMiddleware(c *engine.Context) (res interface{})
- func (actions *Actions) CreatePage(c *engine.Context, args *CreatePageArgs) (*models.Page, error)
- func (actions *Actions) CreateSpace(c *engine.Context, args *CreateSpaceArgs) (*models.Space, error)
- func (actions *Actions) DescribeAccounts(c *engine.Context, args *DescribeAccountsArgs) (*database.Pagination[*models.Account], error)
- func (actions *Actions) DescribePage(c *engine.Context, args *DescribePageArgs) (*models.Page, error)
- func (actions *Actions) DescribePages(c *engine.Context, args *DescribePagesArgs) ([]*models.Page, error)
- func (actions *Actions) DescribeSpace(c *engine.Context, args *DescribeSpaceArgs) (*models.Space, error)
- func (actions *Actions) DescribeSpaces(c *engine.Context, args *DescribeSpacesArgs) (*database.Pagination[*models.Space], error)
- func (actions *Actions) Logout(c *engine.Context) (res interface{})
- func (actions *Actions) Overview(c *engine.Context) (*models.Account, error)
- func (actions *Actions) PreviewMarkdown(c *engine.Context, args *PreviewMarkdownArgs) (render.HTML, error)
- func (actions *Actions) SetPage(c *engine.Context, args *SetPageArgs) error
- func (actions *Actions) SetSpace(c *engine.Context, args *SetSpaceArgs) error
- func (actions *Actions) Signin(c *engine.Context, args *SigninArgs) (*models.Account, error)
- func (actions *Actions) Signup(c *engine.Context, args *SignupArgs) (*models.Account, error)
- func (actions *Actions) UpdateAccount(c *engine.Context, args *UpdateAccountArgs) (*models.Account, error)
- func (actions *Actions) UpdatePage(c *engine.Context, args *UpdatePageArgs) (*models.Page, error)
- func (actions *Actions) UpdateSpace(c *engine.Context, args *UpdateSpaceArgs) (*models.Space, error)
- type CreatePageArgs
- type CreateSpaceArgs
- type DescribeAccountsArgs
- type DescribePageArgs
- type DescribePagesArgs
- type DescribeSpaceArgs
- type DescribeSpacesArgs
- type PreviewMarkdownArgs
- type SetPageArgs
- type SetSpaceArgs
- type SigninArgs
- type SignupArgs
- type UpdateAccountArgs
- type UpdatePageArgs
- type UpdateSpaceArgs
Constants ¶
const SessionAccountKey = "session-login-key"
SessionAccountKey session account context key
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Actions ¶
type Actions struct { Configuration config.Configuration Accounter accounts.Service Spacer spaces.Service }
Actions type
func (*Actions) AuthMiddleware ¶
AuthMiddleware 登录验证中间件
func (*Actions) CreatePage ¶
CreatePage create page POST /api/spaces/:key/pages
func (*Actions) CreateSpace ¶
func (actions *Actions) CreateSpace(c *engine.Context, args *CreateSpaceArgs) (*models.Space, error)
CreateSpace create space POST /api/spaces
func (*Actions) DescribeAccounts ¶
func (actions *Actions) DescribeAccounts(c *engine.Context, args *DescribeAccountsArgs) (*database.Pagination[*models.Account], error)
DescribeAccounts describe accounts GET /api/accounts
func (*Actions) DescribePage ¶
func (actions *Actions) DescribePage(c *engine.Context, args *DescribePageArgs) (*models.Page, error)
DescribePage describe page detail GET /api/spaces/:key/pages/:id
func (*Actions) DescribePages ¶
func (actions *Actions) DescribePages(c *engine.Context, args *DescribePagesArgs) ([]*models.Page, error)
DescribePages describe pages GET /api/spaces/:key/pages
func (*Actions) DescribeSpace ¶
func (actions *Actions) DescribeSpace(c *engine.Context, args *DescribeSpaceArgs) (*models.Space, error)
DescribeSpace describe space detail GET /api/spaces/:key
func (*Actions) DescribeSpaces ¶
func (actions *Actions) DescribeSpaces(c *engine.Context, args *DescribeSpacesArgs) (*database.Pagination[*models.Space], error)
DescribeSpaces describe spaces GET /api/spaces
func (*Actions) PreviewMarkdown ¶
func (actions *Actions) PreviewMarkdown(c *engine.Context, args *PreviewMarkdownArgs) (render.HTML, error)
PreviewMarkdown markdown to html
func (*Actions) SetPage ¶
func (actions *Actions) SetPage(c *engine.Context, args *SetPageArgs) error
SetPage describe space detail MATCH route `/api/spaces/:key/pages/:id`
func (*Actions) SetSpace ¶
func (actions *Actions) SetSpace(c *engine.Context, args *SetSpaceArgs) error
SetSpace describe space detail MATCH route `/api/spaces/:key`
func (*Actions) UpdateAccount ¶
func (actions *Actions) UpdateAccount(c *engine.Context, args *UpdateAccountArgs) (*models.Account, error)
UpdateAccount update account GET /api/accounts
func (*Actions) UpdatePage ¶
UpdatePage update page PATCH /api/spaces/:key/pages/:id
func (*Actions) UpdateSpace ¶
func (actions *Actions) UpdateSpace(c *engine.Context, args *UpdateSpaceArgs) (*models.Space, error)
UpdateSpace update space PATCH /api/spaces/:key
type CreatePageArgs ¶
type CreatePageArgs struct { ParentID int64 `json:"parent_id"` PageID int64 `json:"page_id"` Lang string `json:"lang"` Version string `json:"version"` Status models.PageStatus `json:"status"` Title string `json:"title"` ShortTitle string `json:"short_title"` Body string `json:"body"` }
CreatePageArgs create page args
type CreateSpaceArgs ¶
type CreateSpaceArgs struct { Name string `json:"name"` Key string `json:"key"` Multilingual bool `json:"multilingual"` Lang string `json:"lang"` FallbackLang string `json:"fallback_lang"` Description string `json:"description"` Avatar string `json:"avatar"` Status models.SpaceStatus `json:"status"` }
CreateSpaceArgs create space args
type DescribeAccountsArgs ¶
type DescribeAccountsArgs struct { Q string `query:"q"` database.Pagination[*models.Account] }
DescribeAccountsArgs describe topics args
type DescribePageArgs ¶
type DescribePageArgs struct { PageID string `uri:"id"` Lang string `query:"lang"` Version string `query:"version"` }
DescribePageArgs describe page detail args
type DescribePagesArgs ¶
type DescribePagesArgs struct { Lang string `query:"lang"` Version string `query:"version"` Depth int `query:"depth"` ParentID *int64 `query:"parent_id"` }
DescribePagesArgs describe page detail args
type DescribeSpaceArgs ¶
type DescribeSpaceArgs struct {
Key string `uri:"key"`
}
DescribeSpaceArgs describe space detail args
type DescribeSpacesArgs ¶
type DescribeSpacesArgs struct { database.Pagination[*models.Space] Q string `query:"q"` }
DescribeSpacesArgs describe spaces args
type PreviewMarkdownArgs ¶
type PreviewMarkdownArgs struct {
Content string `json:"content"`
}
PreviewMarkdownArgs create space args
type SetPageArgs ¶
type SetPageArgs struct { PageID int64 `uri:"id"` Lang string `query:"lang" json:"-"` Version string `query:"version" json:"-"` }
SetPageArgs describe space detail args
type SetSpaceArgs ¶
type SetSpaceArgs struct {
Key string `uri:"key"`
}
SetSpaceArgs describe space detail args
type SigninArgs ¶
type SigninArgs struct { Login string `json:"login" binding:"required" validate:"required"` Email string `json:"email" binding:"required" validate:"required,email"` Password string `json:"password" binding:"required" validate:"required,min=8,max=56"` }
SigninArgs user sign in args
type SignupArgs ¶
type SignupArgs struct { Login string `json:"login" binding:"required" validate:"required"` Email string `json:"email" binding:"required" validate:"required,email"` Password string `json:"password" binding:"required" validate:"required,min=8,max=56"` Name string `json:"name"` Bio string `json:"bio"` Location string `json:"location"` }
SignupArgs user sign up args
type UpdateAccountArgs ¶
type UpdateAccountArgs struct { Login string `uri:"login"` Name *string `json:"name"` Bio *string `json:"bio"` Location *string `json:"location"` Status *models.UserStatus `json:"status"` }
UpdateAccountArgs describe topics args
type UpdatePageArgs ¶
type UpdatePageArgs struct { Lang *string `json:"lang"` Version *string `json:"version"` Status *models.PageStatus `json:"status"` Title *string `json:"title"` ShortTitle *string `json:"short_title"` Body *string `json:"body"` }
UpdatePageArgs update page args
type UpdateSpaceArgs ¶
type UpdateSpaceArgs struct { Key string `uri:"key"` Name *string `json:"name"` Multilingual *bool `json:"multilingual"` Lang *string `json:"lang"` FallbackLang *string `json:"fallback_lang"` HomepageID *int64 `json:"homepage_id"` Description *string `json:"description"` Avatar *string `json:"avatar"` Status models.SpaceStatus `json:"status"` }
UpdateSpaceArgs update space args