models

package
v0.0.0-...-b1bf2c7 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRequiredFieldNotPresent = errors.New("required field not present")
)

Functions

func RegisterSchema

func RegisterSchema(db *gorm.DB) error

Types

type Alert

type Alert struct {
	Model
	AlertID     string  `json:"alert_id"`     // AlertID is the unique identifier for an alert
	Email       string  `json:"email"`        // Email is the email address of the user who created the alert
	TriggerMail bool    `json:"trigger_mail"` // TriggerMail is a boolean value that determines if the user wants to receive an email notification when the alert is triggered
	AlertValue  float64 `json:"alert_value"`  // AlertValue is the value that the user wants to be alerted when the price of the coin reaches
	Status      string  `json:"status"`       // Status is the status of the alert. It can be either active or inactive
}

func (*Alert) Create

func (c *Alert) Create(db *gorm.DB) error

func (*Alert) Delete

func (c *Alert) Delete(db *gorm.DB) error

func (*Alert) Get

func (c *Alert) Get(db *gorm.DB) error

func (*Alert) GetByOffset

func (c *Alert) GetByOffset(db *gorm.DB, offset int, limit int) ([]Alert, error)

func (*Alert) List

func (c *Alert) List(db *gorm.DB) ([]Alert, error)

func (*Alert) Update

func (c *Alert) Update(db *gorm.DB) error

type Cache

type Cache struct {
	Model
	PageNo   int    `json:"page_no"`   // PageNo is the page number of the cache
	PageSize int    `json:"page_size"` // PageSize is the page size of the cache
	Status   string `json:"status"`    // Status is the status of the alert
}

func (*Cache) Create

func (d *Cache) Create(db *gorm.DB) error

func (*Cache) Delete

func (d *Cache) Delete(db *gorm.DB) error

func (*Cache) Get

func (d *Cache) Get(db *gorm.DB) error

func (*Cache) List

func (d *Cache) List(db *gorm.DB) ([]Cache, error)

func (*Cache) Update

func (d *Cache) Update(db *gorm.DB) error

type Coins

type Coins struct {
	Name  string  `json:"name"`  // Name is the name of the coin
	Price float64 `json:"price"` // Price is the price of the coin
}

func (*Coins) Create

func (d *Coins) Create(db *gorm.DB) error

func (*Coins) Delete

func (d *Coins) Delete(db *gorm.DB) error

func (*Coins) Get

func (d *Coins) Get(db *gorm.DB) error

func (*Coins) List

func (d *Coins) List(db *gorm.DB) ([]Coins, error)

func (*Coins) Update

func (d *Coins) Update(db *gorm.DB) error

type Model

type Model struct {
	UserID    string    `json:"user_id"`              // UserID is the user id of the model
	CreatedAt time.Time `json:"created_at,omitempty"` // CreatedAt is the created at of the model
	UpdatedAt time.Time `json:"updated_at,omitempty"` // UpdatedAt is the updated at of the model
}

type Websocket

type Websocket struct {
	C string `json:"c"` // C is the identifier used to unmarshal the websocket message
}

func (*Websocket) Create

func (d *Websocket) Create(db *gorm.DB) error

func (*Websocket) Delete

func (d *Websocket) Delete(db *gorm.DB) error

func (*Websocket) Get

func (d *Websocket) Get(db *gorm.DB) error

func (*Websocket) List

func (d *Websocket) List(db *gorm.DB) ([]Websocket, error)

func (*Websocket) Update

func (d *Websocket) Update(db *gorm.DB) error

Jump to

Keyboard shortcuts

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