utils

package
v0.0.0-...-69ebceb Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractToken

func ExtractToken(c *gin.Context) string

func ExtractTokenID

func ExtractTokenID(c *gin.Context) (uint, string, error)

func GenerateJwtToken

func GenerateJwtToken(userId uint, email string, role string) (string, error)

func GetLimitAndOffset

func GetLimitAndOffset(c *gin.Context) (int, int)

func TokenValid

func TokenValid(c *gin.Context) error

Types

type Config

type Config struct {
	DBDriver   string `mapstructure:"DB_DRIVER"`
	DBUser     string `mapstructure:"DB_USER"`
	DBPassword string `mapstructure:"DB_PASS"`
	DBHost     string `mapstructure:"DB_HOST"`
	DBPort     string `mapstructure:"DB_PORT"`
	DBName     string `mapstructure:"DB_NAME"`
}

func LoadConfig

func LoadConfig(path string) (config Config, err error)

type OrderStatus

type OrderStatus int
const (
	Pending OrderStatus = iota
	Accepted
)

func (OrderStatus) String

func (o OrderStatus) String() string

type UserRole

type UserRole int
const (
	Buyer UserRole = iota
	Seller
)

func (UserRole) String

func (r UserRole) String() string

Jump to

Keyboard shortcuts

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