user

package
v0.0.0-...-5845185 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2022 License: CC0-1.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(db *gorm.DB, apiKey common.Hash, address common.Address) bool

Create - Create new user i.e. APIKey insertion is actually being performed here

func Disable

func Disable(db *gorm.DB, apiKey common.Hash) bool

Disable - Given exisiting ( enabled ) APIKey, attempts to deactivate it

func Enable

func Enable(db *gorm.DB, apiKey common.Hash) bool

Enable - Given exisiting ( disabled ) APIKey, attempts to activate it

func GenerateNewAPIKey

func GenerateNewAPIKey(db *gorm.DB, address common.Address) []byte

GenerateNewAPIKey - Given user address, attempts to generate a new APIKey for that user, by applying keccak256 hash on top of a JSON serialized message

In that message of certain structure, current UNIX timestamp with nano-second level precision is also used, to reduce chance of collision

What it denotes, is no repeated APIKey will ( in sometime soon ) ever be generated

func GetNonce

func GetNonce(db *gorm.DB, address common.Address) uint64

GetNonce - Retrieves how many APIKey(s) are created by this user address

Types

This section is empty.

Jump to

Keyboard shortcuts

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