Documentation
¶
Index ¶
- Constants
- func CheckModerationVariables(config *model.Config) error
- func GetGinContext(ctx context.Context) *gin.Context
- func GetServer(db *abstraction.Database, config *model.Config) (*gin.Engine, error)
- func LoggerMiddleware() gin.HandlerFunc
- func NormalizePath(input string) string
- func ShortenAuthor(input string, allowedLength int) string
- type CreateCommentInput
- type CreateCommentOutput
- type DeleteCommentInput
- type GetAdminConfigOutput
- type GetAllCommentsOutput
- type GetAllThreadsOutput
- type GetClientConfigOutput
- type GetCommentsInput
- type GetCommentsOutput
- type LoginInput
- type Router
- func (r *Router) CreateComment(ctx context.Context, input *CreateCommentInput) (*CreateCommentOutput, error)
- func (r *Router) DeleteComment(ctx context.Context, input *DeleteCommentInput) (*struct{}, error)
- func (r *Router) GetAdminConfig(ctx context.Context, input *struct{}) (*GetAdminConfigOutput, error)
- func (r *Router) GetAllComments(ctx context.Context, input *struct{}) (*GetAllCommentsOutput, error)
- func (r *Router) GetAllThreads(ctx context.Context, input *struct{}) (*GetAllThreadsOutput, error)
- func (r *Router) GetClientConfig(ctx context.Context, input *struct{}) (*GetClientConfigOutput, error)
- func (r *Router) GetComments(ctx context.Context, input *GetCommentsInput) (*GetCommentsOutput, error)
- func (r *Router) Login(ctx context.Context, input *LoginInput) (*struct{}, error)
- func (r *Router) OAuth(c *gin.Context)
- func (r *Router) OAuthCallback(c *gin.Context)
- func (r *Router) RegisterHumaRoutes(api huma.API, limitMiddleware func(huma.Context, func(huma.Context)))
- func (r *Router) RestoreDeletedComment(ctx context.Context, input *DeleteCommentInput) (*struct{}, error)
- func (r *Router) SetProviders(input map[string]*provider.Provider)
- func (r *Router) Status(ctx context.Context, input *struct{}) (*StatusOutput, error)
- func (r *Router) UpdateComment(ctx context.Context, input *UpdateCommentInput) (*struct{}, error)
- type StatusOutput
- type UnmoderatedFs
- type UpdateCommentInput
Constants ¶
View Source
const GinContextKey = "gin_context"
Variables ¶
This section is empty.
Functions ¶
func LoggerMiddleware ¶
func LoggerMiddleware() gin.HandlerFunc
func NormalizePath ¶
NormalizePath adds a missing slash at the front or the end of given input path
func ShortenAuthor ¶
ShortenAuthor shortens the author name to an acceptable lenght, suffixing it with ...
Types ¶
type CreateCommentInput ¶
type CreateCommentInput struct {
Body model.CreateCommentBody
}
type CreateCommentOutput ¶
type CreateCommentOutput struct {
Body model.CreateCommentResponse
}
type DeleteCommentInput ¶
type DeleteCommentInput struct {
Body model.DeleteCommentBody
}
type GetAdminConfigOutput ¶
type GetAdminConfigOutput struct {
Body configModel.AdminConfig
}
type GetAllCommentsOutput ¶
type GetAllThreadsOutput ¶
type GetClientConfigOutput ¶
type GetClientConfigOutput struct {
Body configModel.ClientConfig
}
type GetCommentsInput ¶
type GetCommentsInput struct {
Uri string `query:"uri" doc:"The thread URI"`
}
type GetCommentsOutput ¶
type LoginInput ¶
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func New ¶
func New(db *abstraction.Database, config *configModel.Config, cache *cache.Cache) *Router
func (*Router) CreateComment ¶
func (r *Router) CreateComment(ctx context.Context, input *CreateCommentInput) (*CreateCommentOutput, error)
func (*Router) DeleteComment ¶
func (r *Router) DeleteComment(ctx context.Context, input *DeleteCommentInput) (*struct{}, error)
func (*Router) GetAdminConfig ¶
func (r *Router) GetAdminConfig(ctx context.Context, input *struct{}) (*GetAdminConfigOutput, error)
func (*Router) GetAllComments ¶
func (r *Router) GetAllComments(ctx context.Context, input *struct{}) (*GetAllCommentsOutput, error)
func (*Router) GetAllThreads ¶
func (r *Router) GetAllThreads(ctx context.Context, input *struct{}) (*GetAllThreadsOutput, error)
func (*Router) GetClientConfig ¶
func (r *Router) GetClientConfig(ctx context.Context, input *struct{}) (*GetClientConfigOutput, error)
func (*Router) GetComments ¶
func (r *Router) GetComments(ctx context.Context, input *GetCommentsInput) (*GetCommentsOutput, error)
func (*Router) Login ¶
func (r *Router) Login(ctx context.Context, input *LoginInput) (*struct{}, error)
func (*Router) OAuthCallback ¶
func (*Router) RegisterHumaRoutes ¶
func (*Router) RestoreDeletedComment ¶
func (r *Router) RestoreDeletedComment(ctx context.Context, input *DeleteCommentInput) (*struct{}, error)
func (*Router) Status ¶
func (r *Router) Status(ctx context.Context, input *struct{}) (*StatusOutput, error)
func (*Router) UpdateComment ¶
func (r *Router) UpdateComment(ctx context.Context, input *UpdateCommentInput) (*struct{}, error)
type StatusOutput ¶
type StatusOutput struct {
Body struct {
Message string `json:"message"`
}
}
type UnmoderatedFs ¶
type UnmoderatedFs struct {
http.FileSystem
}
UnmoderatedFs a file system we use to serve only the client.js
type UpdateCommentInput ¶
type UpdateCommentInput struct {
Body model.UpdateCommentBody
}
Click to show internal directories.
Click to hide internal directories.