model

package
Version: v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LimitStringField

func LimitStringField(s string, maxRunes uint) string

LimitStringField crops string

Types

type Sending

type Sending struct {
	ID           uint64    `gorm:"PRIMARY_KEY;AUTO_INCREMENT:true"`
	Status       uint8     `gorm:"NOT NULL"`
	StatusString string    `gorm:"SIZE:16;NOT NULL"`
	Dst          []byte    `gorm:"SIZE:20;NOT NULL"`
	DstTx        []byte    `gorm:"SIZE:32"`
	Token        string    `gorm:"SIZE:4;NOT NULL"`
	Amount       string    `gorm:"NOT NULL" sql:"TYPE:decimal(30,18)"`
	Src          []byte    `gorm:"SIZE:32;NOT NULL"`
	SrcTx        []byte    `gorm:"SIZE:32;NOT NULL"`
	NextCheckAt  time.Time `gorm:"NOT NULL;DEFAULT:current_timestamp"`
}

Sending model

func (*Sending) From

func (s *Sending) From(t *types.Sending) error

From mapping

func (*Sending) To

func (s *Sending) To() (*types.Sending, error)

To mapping

type Setting

type Setting struct {
	Key   string `gorm:"PRIMARY_KEY;NOT NULL"`
	Value string `gorm:"SIZE:1024;NOT NULL"`
}

Setting model

type Swap

type Swap struct {
	ID           uint64    `gorm:"PRIMARY_KEY;AUTO_INCREMENT:true;NOT NULL"`
	Status       uint8     `gorm:"NOT NULL"`
	StatusString string    `gorm:"SIZE:16;NOT NULL"`
	Src          []byte    `gorm:"SIZE:20;NOT NULL"`
	SrcTx        []byte    `gorm:"SIZE:32;NOT NULL"`
	Token        string    `gorm:"SIZE:4;NOT NULL"`
	Amount       string    `gorm:"NOT NULL" sql:"TYPE:decimal(30,18)"`
	Dst          []byte    `gorm:"SIZE:32;NOT NULL"`
	DstTx        []byte    `gorm:"SIZE:32"`
	NextCheckAt  time.Time `gorm:"NOT NULL;DEFAULT:current_timestamp"`
}

Swap model

func (*Swap) From

func (s *Swap) From(t *types.Swap) error

From mapping

func (*Swap) To

func (s *Swap) To() (*types.Swap, error)

To mapping

Jump to

Keyboard shortcuts

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