routes

package
v1.0.2-0...-fe75df2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApiIndex

func ApiIndex(ctx *fiber.Ctx) error

func CreateImage

func CreateImage(c *fiber.Ctx) error

Upload a new image

func CreateUser

func CreateUser(c *fiber.Ctx) error

Creates a new user (different from registering a user)

func GetImage

func GetImage(c *fiber.Ctx) error

Get a single image

func GetImages

func GetImages(c *fiber.Ctx) error

TODO: Implementaion Get all images

func GetUser

func GetUser(c *fiber.Ctx) error

Gets a single user by id param (different from getting the auth user)

func Login

func Login(c *fiber.Ctx) error

func Me

func Me(c *fiber.Ctx) error

Get the user that is "currently logged in" aka from the auth token

func Register

func Register(c *fiber.Ctx) error

TODO: Implementaion

Types

type Image

type Image struct {
	Id        string `json:"id"`
	Name      string `json:"name"`
	Ext       string `json:"ext"`
	Uploader  string `json:"uploader"`
	CreatedAt string `json:"created_at"`
}

type ImageResponse

type ImageResponse struct {
	Success      bool   `json:"success"`
	ThumbnailURL string `json:"thumbnail_url"`
	ImageURL     string `json:"image_url"`
	DeletionURL  string `json:"deletion_url"`
}

type LoginBody

type LoginBody struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

type LoginUser

type LoginUser struct {
	models.User
	Password string `json:"password"`
}

type NewUser

type NewUser struct {
	models.User
	Password string `json:"password"`
}

type UserResponse

type UserResponse struct {
	Success bool        `json:"success"`
	User    models.User `json:"user"`
}

Jump to

Keyboard shortcuts

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