models

package
v0.0.0-...-95cc352 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package models exposes a set of models

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBService

type DBService struct {
	Wallet *walletGorm
	// contains filtered or unexported fields
}

DBService represents the database connection service

func NewDBService

func NewDBService(dbConnInfo string) (*DBService, error)

NewDBService handles the database connection

func (*DBService) AutoMigrate

func (s *DBService) AutoMigrate() error

AutoMigrate will attempt to automatically migrate all tables

func (*DBService) Close

func (s *DBService) Close() error

Close closes the database connection

type Wallet

type Wallet struct {
	gorm.Model
	WID     string          `gorm:"not null;unique_index"`
	Balance decimal.Decimal `sql:"type:decimal(20,8);"`
}

Wallet represents a wallet object in our database.

Jump to

Keyboard shortcuts

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