models

package
v0.0.0-...-816c9d6 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Contract

type Contract struct {
	gorm.Model
	Id            string
	ContractId    *ContractID
	GasUsed       uint64
	TransactionId string
	Timestamp     time.Time
	ChargeFee     string
	PayerAccount  string
	Status        string
	CreatedAt     time.Time
	UpdatedAt     time.Time
}

contract model

type ContractID

type ContractID hedera.ContractID

init hedera contract id

func (*ContractID) Scan

func (c *ContractID) Scan(value interface{}) error

method to unmarshal the contract id data the contract id from hedera is in pointer, we need to unmarshal it to a usable form

func (ContractID) Value

func (c ContractID) Value() (driver.Value, error)

method to marshal the contract id data this is used to convert an contract id back into a suitable hedera form of memory pointer

type Products

type Products struct {
	gorm.Model
	ProductID        string
	Color            string
	Quantity         int64
	Timestamp        time.Time
	ContractId       *ContractID
	ContractIdString string
	GasUsed          uint64
	TransactionId    string
	ChargeFee        string
	PayerAccount     string
	Status           string
	ReceiptPDF       string
	CreatedAt        time.Time
}

declare the database table and the record the table should always contain

Jump to

Keyboard shortcuts

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