goauthpack

package module
v0.0.0-...-b38bd29 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2022 License: MIT Imports: 12 Imported by: 0

README

goauthpack

Reusable integrated authentication library

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvaild error = errors.New("invalid Session")

ErrInvaild :Errors that occur when the session is invalid

Functions

func InitSigner

func InitSigner(SecretKey string, exp int64)

InitSigner : Initialize the signer

func NewSession

func NewSession(UserName string, Data map[string]string) (string, error)

NewSession : Create New Session String

func ReadSession

func ReadSession(session string) (UserName string, Data map[string]string, err error)

ReadSession : Verify the session

Types

type Session

type Session struct {
	SessionID string            `json:"sessionid"`
	Version   int               `json:"v"`
	Issue     int               `json:"iat"`
	UserName  string            `json:"sub"`
	Data      map[string]string `json:"data"`
}

Session struct

Jump to

Keyboard shortcuts

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