Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Router *mux.Router
	// contains filtered or unexported fields
}

App has router and db instances

func (*App) AuthenticateMiddleware

func (a *App) AuthenticateMiddleware(next http.HandlerFunc) http.HandlerFunc

func (*App) CreateBoard

func (a *App) CreateBoard(w http.ResponseWriter, r *http.Request)

func (*App) CreateComment

func (a *App) CreateComment(w http.ResponseWriter, r *http.Request)

func (*App) CreatePost

func (a *App) CreatePost(w http.ResponseWriter, r *http.Request)

func (*App) Delete

func (a *App) Delete(path string, f func(w http.ResponseWriter, r *http.Request))

Delete wraps the router for DELETE method

func (*App) DeleteComment

func (a *App) DeleteComment(w http.ResponseWriter, r *http.Request)

func (*App) DeletePost

func (a *App) DeletePost(w http.ResponseWriter, r *http.Request)

func (*App) DownloadFile

func (a *App) DownloadFile(w http.ResponseWriter, r *http.Request)

func (*App) Get

func (a *App) Get(path string, f func(w http.ResponseWriter, r *http.Request))

Get wraps the router for GET method

func (*App) GetAllCategories

func (a *App) GetAllCategories(w http.ResponseWriter, r *http.Request)

func (*App) GetAllPosts

func (a *App) GetAllPosts(w http.ResponseWriter, r *http.Request)

func (*App) GetBoards

func (a *App) GetBoards(w http.ResponseWriter, r *http.Request)

func (*App) GetCommentsByUser

func (a *App) GetCommentsByUser(w http.ResponseWriter, r *http.Request)

func (*App) GetPost

func (a *App) GetPost(w http.ResponseWriter, r *http.Request)

func (*App) GetPostsByBoard

func (a *App) GetPostsByBoard(w http.ResponseWriter, r *http.Request)

func (*App) GetPostsBySubscriptions

func (a *App) GetPostsBySubscriptions(w http.ResponseWriter, r *http.Request)

func (*App) GetPostsByUser

func (a *App) GetPostsByUser(w http.ResponseWriter, r *http.Request)

func (*App) GetUserProfile

func (a *App) GetUserProfile(w http.ResponseWriter, r *http.Request)

func (*App) GetUsersBoards

func (a *App) GetUsersBoards(w http.ResponseWriter, r *http.Request)

func (*App) GetUsersNotifications

func (a *App) GetUsersNotifications(w http.ResponseWriter, r *http.Request)

func (*App) Initialize

func (a *App) Initialize(config *config.Config)

Initialize initializes the app with predefined configuration

func (*App) Login

func (a *App) Login(w http.ResponseWriter, r *http.Request)

func (*App) MarkAsRead

func (a *App) MarkAsRead(w http.ResponseWriter, r *http.Request)

func (*App) Post

func (a *App) Post(path string, f func(w http.ResponseWriter, r *http.Request))

Post wraps the router for POST method

func (*App) Put

func (a *App) Put(path string, f func(w http.ResponseWriter, r *http.Request))

Put wraps the router for PUT method

func (*App) ReactionComment

func (a *App) ReactionComment(w http.ResponseWriter, r *http.Request)

func (*App) ReactionPost

func (a *App) ReactionPost(w http.ResponseWriter, r *http.Request)

func (*App) Redirect

func (a *App) Redirect(w http.ResponseWriter, r *http.Request)

func (*App) Run

func (a *App) Run(host string)

Run the app on it's router

func (*App) Subscribe

func (a *App) Subscribe(w http.ResponseWriter, r *http.Request)

func (*App) Unsubscribe

func (a *App) Unsubscribe(w http.ResponseWriter, r *http.Request)

func (*App) UpdateComment

func (a *App) UpdateComment(w http.ResponseWriter, r *http.Request)

func (*App) UpdatePost

func (a *App) UpdatePost(w http.ResponseWriter, r *http.Request)

func (*App) UploadFile

func (a *App) UploadFile(w http.ResponseWriter, r *http.Request)

type Claims

type Claims struct {
	UserID   uint   `json:"user_id"`
	Username string `json:"username"`
	Role     string `json:"role"`
	jwt.StandardClaims
}

type OAuthAccessResponse

type OAuthAccessResponse struct {
	AccessToken  string `json:"access_token"`
	TokenType    string `json:"token_type"`
	ExpiresIn    int    `json:"expires_in"`
	RefreshToken string `json:"refresh_token"`
}

type RequestCode

type RequestCode struct {
	ClientID     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`
	Code         string `json:"code"`
	GrantType    string `json:"grant_type"`
	RedirectURI  string `json:"redirect_uri"`
}

Directories

Path Synopsis
util