utils

package
v0.0.0-...-b38aa6c Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Config = struct {
	AppName string `default:"app name"`

	Database struct {
		Host     string `default:"localhost"`
		User     string `default:"root"`
		Password string `required:"true" env:"password"`
		Port     string `default:"27017"`
	}

	RabbitMq struct {
		Host     string `default:"localhost"`
		User     string `default:"user"`
		Password string `required:"true" env:"secret"`
		Port     string `default:"5672"`
	}

	Contacts []struct {
		Name  string
		Email string `required:"true"`
	}
}{}

https://github.com/jinzhu/configor

Functions

func CreateToken

func CreateToken(email string) (*models.TokenResponse, error)

Types

type JsonWebToken

type JsonWebToken struct {
	Token      string
	UserName   string
	ExpireDate int64
	CreatedAt  time.Time
}

func CreateRefreshToken

func CreateRefreshToken(username string) (*JsonWebToken, error)

encapsulation model

Jump to

Keyboard shortcuts

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