domain

package
v0.0.0-...-12d229b Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Db = map[string]User{}
View Source
var OauthConnections = map[string]string{}

OauthConnections key: user id from oauth provider, value: user id in this system eg. email

View Source
var Sessions = map[string]string{}

Functions

func CreateToken

func CreateToken(userId string) (string, error)

func NewGithubOauthConfig

func NewGithubOauthConfig() *oauth2.Config

func NewGoogleOauthConfig

func NewGoogleOauthConfig() *oauth2.Config

func ParseToken

func ParseToken(token string) (string, error)

Types

type GithubUserResponse

type GithubUserResponse struct {
	Data struct {
		Viewer struct {
			ID    string `json:"id"`
			Name  string `json:"name"`
			Email string `json:"email"`
		} `json:"viewer"`
	} `json:"data"`
}

type GoogleUserResponse

type GoogleUserResponse struct {
	ID            string `json:"id"`
	Email         string `json:"email"`
	VerifiedEmail bool   `json:"verified_email"`
	Name          string `json:"name"`
	GivenName     string `json:"given_name"`
	FamilyName    string `json:"family_name"`
	Picture       string `json:"picture"`
	Locale        string `json:"locale"`
}

type MyClaims

type MyClaims struct {
	jwt.StandardClaims
	UserId string `json:"user_id"`
}

type User

type User struct {
	Name     string
	Password []byte
}

Jump to

Keyboard shortcuts

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