db

package
v0.0.0-...-07657c1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectDB

func ConnectDB() *gorm.DB

ConnectDB function connects to the database and inits migration.

  • Returns *gorm.DB

Types

type Block

type Block struct {
	ID        uint   `gorm:"primaryKey"`
	Network   string `gorm:"unique"`
	Height    uint64
	CreatedAt time.Time
	UpdatedAt time.Time
}

Block struct provides model definition for the block table.

type Transaction

type Transaction struct {
	ID        uint   `gorm:"primaryKey"`
	Hash      string `gorm:"unique"`
	From      string
	To        string
	Value     string
	CreatedAt time.Time
}

Transaction struct provides model definition for the transaction table.

type Wallet

type Wallet struct {
	ID        uint   `gorm:"primaryKey"`
	Address   string `gorm:"unique"`
	CreatedAt time.Time
}

Wallet struct provides model definition for the wallet table.

Jump to

Keyboard shortcuts

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