auth

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

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

Go to latest
Published: May 9, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OauthGithub uint64 = 0
)

Oauth type

Variables

View Source
var ErrorWrongToken = errors.New("wrong token")

Functions

func SetupRouter

func SetupRouter(anonymousGroup *gin.RouterGroup, authGroup *gin.RouterGroup)

SetupRouter : set up auth router

Types

type Profile

type Profile struct {
	Username string `json:"username"`
	ID       uint64 `json:"id"`
	Email    string `json:"email"`
}

Profile : User's profile get from github

type User

type User struct {
	ID          uint64 `gorm:"primaryKey;"`
	AccessToken string `gorm:"type:varchar(128);" json:"-"`
	TokenType   uint64 `gorm:"type:int;" json:"-"`
	Role        uint64 `gorm:"type:int;"`
	CreatedAt   time.Time
}

User : struct for user

Jump to

Keyboard shortcuts

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