ultis

package
v0.0.0-...-1b56600 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAdminToken

func CreateAdminToken() (string, error)

func CreateToken

func CreateToken(oid primitive.ObjectID, isLec bool) (string, error)

func ParseAdminToken

func ParseAdminToken(authToken string, claims *AdminClaims) (*jwt.Token, error)

func ParseToken

func ParseToken(authToken string, claims *UserClaims) (*jwt.Token, error)

func SendMail

func SendMail(toUser string, email string, subject string, content string) error

Types

type AdminClaims

type AdminClaims struct {
	jwt.StandardClaims
}

type Config

type Config struct {
	Port       int32
	DbUsername string
	DbPassword string
	DbUrl      string
	DbName     string
}

func LoadConfigFile

func LoadConfigFile() (*Config, error)

type UserClaims

type UserClaims struct {
	Id    primitive.ObjectID
	IsLec bool
	jwt.StandardClaims
}

Jump to

Keyboard shortcuts

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