models

package
v0.0.13-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2022 License: GPL-3.0 Imports: 2 Imported by: 0

README

Models

This folder holds all models
Models realted to database and also models used in app can be found here

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FlowId

type FlowId struct {
	FlowIdType    FlowIdType `sql:"flow_id_type"`
	WalletAddress string
	FlowId        string `gorm:"primary_key"`
	RelatedRoleId string
}

TODO: Make relations for field `relatedRoleId`

type FlowIdType

type FlowIdType string
const (
	AUTH FlowIdType = "AUTH"
	ROLE FlowIdType = "ROLE"
)

func (*FlowIdType) Scan

func (fit *FlowIdType) Scan(value interface{}) error

func (FlowIdType) Value

func (fit FlowIdType) Value() (driver.Value, error)

type Role

type Role struct {
	Name   string `gorm:"unique"`
	RoleId string `gorm:"primary_key"`
	Eula   string
}

type User

type User struct {
	Name              string         `json:"name,omitempty"`
	WalletAddress     string         `gorm:"primary_key" json:"walletAddress"`
	FlowIds           []FlowId       `gorm:"foreignkey:WalletAddress" json:"-"`
	ProfilePictureUrl string         `json:"profilePictureUrl,omitempty"`
	Country           string         `json:"country,omitempty"`
	Feedbacks         []UserFeedback `gorm:"foreignkey:WalletAddress" json:"userFeedbacks"`
}

type UserFeedback

type UserFeedback struct {
	WalletAddress string    `json:"-" gorm:"primary_key"`
	Feedback      string    `json:"feedback" binding:"required" gorm:"primary_key"`
	Rating        int       `json:"rating" binding:"gte=1,lte=5" gorm:"primary_key"`
	CreatedAt     time.Time `json:"-"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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