32 lines
1.1 KiB
Go
32 lines
1.1 KiB
Go
package endpoints
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func Run() {
|
|
r := gin.Default()
|
|
|
|
public := r.Group("/")
|
|
|
|
public.POST("/login", login) //web login
|
|
public.POST("/access", func(c *gin.Context) {}) //access token
|
|
|
|
private := r.Group("/")
|
|
private.Use(userIsAuthorized)
|
|
|
|
private.PATCH("/login", updateLogin) //change username/password (required before adding bots)
|
|
|
|
private.GET("/bots", func(c *gin.Context) {}) //generalized list of bots
|
|
private.GET("/bot/:bot", func(c *gin.Context) {}) //specific bot
|
|
private.POST("/bot/", func(c *gin.Context) {}) //add bot given token
|
|
private.DELETE("/bot/:bot", func(c *gin.Context) {}) //remove bot
|
|
|
|
private.GET("/tokens", func(c *gin.Context) {}) //generalized list of tokens
|
|
private.GET("/token/:token", func(c *gin.Context) {}) //specific token
|
|
private.POST("/token/", func(c *gin.Context) {}) //new token given bot (so you cant add a token if theres no bots)
|
|
private.DELETE("/token/:token", func(c *gin.Context) {}) //remove token
|
|
private.PATCH("/token/:token", func(c *gin.Context) {}) //update token given bot
|
|
|
|
r.Run()
|
|
} |