models

package
v0.0.0-...-d101602 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2019 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeProfile

type NodeProfile struct {
	// Default Gorm Model Properties
	// Stating here to remove from JSON responses with `json:"-"`
	ID             uint       `json:"-" gorm:"primary_key"`
	CreatedAt      time.Time  `json:"-"`
	UpdatedAt      time.Time  `json:"-"`
	DeletedAt      *time.Time `json:"-"`
	Name           string     `json:"name" gorm:"not null"`
	Email          string     `json:"email" gorm:"not null"`
	Bio            string     `json:"bio" gorm:"not null"`
	Location       string     `json:"location" gorm:"not null"`
	IPAddress      string     `json:"-" gorm:"not null"`
	EstimatedSpeed int        `json:"estimatedSpeed" gorm:"not null"`
	PoolAccepted   bool       `json:"-" gorm:"default:false"`
	NodeAccepted   bool       `json:"-" gorm:"default:false"`
	Pending        bool       `json:"pending" gorm:"default:true"`
	Approved       bool       `json:"approved" gorm:"default:false"`
	Wallet         string     `json:"wallet" gorm:"not null; unique"`
}

func CreateApplication

func CreateApplication(payload *NodeRequestPayload) NodeProfile

func (*NodeProfile) AfterUpdate

func (profile *NodeProfile) AfterUpdate(db *gorm.DB) (err error)

type NodeRequestPayload

type NodeRequestPayload struct {
	EstimatedSpeed int    `json:"estimatedSpeed"`
	Wallet         string `json:"wallet"`
	Name           string `json:"name"`
	Email          string `json:"email"`
	Bio            string `json:"bio"`
	Location       string `json:"location"`
	IPAddress      string `json:"ipAddress"`
}

type PoolInformation

type PoolInformation struct {
	// Default Gorm Model Properties
	// Stating here to remove from JSON responses with `json:"-"`
	ID        uint       `json:"-" gorm:"primary_key"`
	CreatedAt time.Time  `json:"-"`
	UpdatedAt time.Time  `json:"-"`
	DeletedAt *time.Time `json:"-"`

	OnlyRow   int    `json:"-" gorm:"unique;not null;default:1"`
	Address   string `json:"address" gorm:"not null"`
	Name      string `json:"name" gorm:"not null"`
	Bio       string `json:"bio"`
	Location  string `json:"location" gorm:"not null"`
	Rating    int    `json:"rating"`
	NodeCount int    `json:"nodeCount" gorm:"not null;default:0"`
	Wallet    string `json:"wallet" gorm:"not null"`
	Email     string `json:"email" gorm:"not null"`
	Url       string `json:"url" gorm:"-"`
	Public    bool   `json:"public" gorm:"not null;default:false"`
}

func (PoolInformation) TableName

func (PoolInformation) TableName() string

Jump to

Keyboard shortcuts

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