repository

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ManifestModel

type ManifestModel struct {
	gorm.Model
	Address string    `json:"address" gorm:"uniqueindex"`
	ChainId int64     `json:"chainId"`
	User    UserModel `json:"user"`
	UserID  string    `json:"user_id"`
}

type TierModel

type TierModel struct {
	gorm.Model
	Name string
}

type UserModel

type UserModel struct {
	gorm.Model
	ID        string    `json:"id" gorm:"primarykey"`
	Email     string    `json:"email"`
	Address   string    `json:"address"`
	LastLogin time.Time `json:"lastLogin"`
	Nonce     string    `json:"nonce"`
	TierID    uint      `json:"tierId" gorm:"default:0"`
	Tier      TierModel `json:"tier"`
}

type UserRepository

type UserRepository interface {
	Migrate() error
	Create(c context.Context, user UserModel) error
	Get(c context.Context, id string) (UserModel, error)
	GetByEmail(c context.Context, email string) (UserModel, error)
	GetByAddress(c context.Context, address string) (UserModel, error)
	NewLogin(c context.Context, id string, nonce string) error
	CreateManifest(c context.Context, manifest ManifestModel) error
	GetManifests(c context.Context, userId string) ([]ManifestModel, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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