user

package
v0.0.0-...-836e728 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package user provides model, methods and hooks to manage user data

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(id string, mnemonic string) error

Add adds user with given id and mnemonic to database

Types

type CustodialUser

type CustodialUser struct {
	Id       string `json:"-" gorm:"primaryKey;not null"`
	Mnemonic string `json:"-" gorm:"unique;not null"`
}

CustodialUser custodial user model with id and mnemonic

func Get

func Get(id string) (*CustodialUser, error)

Get returns user with given id from database

func (*CustodialUser) AfterFind

func (u *CustodialUser) AfterFind(tx *gorm.DB) (err error)

AfterFind decodes the mnemonic from hexadecimal after finding it from database

func (*CustodialUser) BeforeSave

func (u *CustodialUser) BeforeSave(tx *gorm.DB) (err error)

BeforeSave encodes the mnemonic in hexadecimal before saving it into database

Directories

Path Synopsis
Package usermethods provides core methods for user logic
Package usermethods provides core methods for user logic

Jump to

Keyboard shortcuts

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