api

package
v0.0.0-...-5c3bfc1 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ValidCurrency validator.Func = func(fl validator.FieldLevel) bool {
	if currency, ok := fl.Field().Interface().(string); ok {
		return utils.IsSupportedCurrency(currency)
	}

	return false
}

Functions

This section is empty.

Types

type CreateUserRequest

type CreateUserRequest struct {
	Username string `json:"username" binding:"required,alphanum"`
	Password string `json:"password" binding:"required,min=6"`
	FullName string `json:"full_name" binding:"required"`
	Email    string `json:"email" binding:"required,email"`
}

type LoginUserRequest

type LoginUserRequest struct {
	Username string `json:"username" binding:"required,alphanum"`
	Password string `json:"password" binding:"required,min=6"`
}

type LoginUserResponse

type LoginUserResponse struct {
	Username string
	Token    string
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(config utils.Config, store db.Store) (*Server, error)

func (*Server) CreateUser

func (server *Server) CreateUser(ctx *gin.Context)

func (*Server) LoginUser

func (server *Server) LoginUser(ctx *gin.Context)

func (*Server) Start

func (server *Server) Start(address string) error

Jump to

Keyboard shortcuts

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