database

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2018 License: MIT Imports: 6 Imported by: 0

README

☕️ database GoDoc Build Status codecov Go Report Card

Package database provides PostgreSQL management for Temporal, an easy-to-use interface into distributed and decentralized storage technologies for personal and enterprise use cases.

Documentation

Overview

Package database provides PostgreSQL management for Temporal (https://github.com/RTradeLtd/Temporal), an easy-to-use interface into distributed and decentralized storage technologies for personal and enterprise use cases.

Index

Constants

This section is empty.

Variables

View Source
var (
	// UploadObj is our upload model
	UploadObj *models.Upload
	// EncryptedUploadObj is our encrypted upload model
	EncryptedUploadObj *models.EncryptedUpload
	// UserObj is our user model
	UserObj *models.User
	// PaymentObj is our payment model
	PaymentObj *models.Payments
	// IpnsObj is our ipns model
	IpnsObj *models.IPNS
	// HostedIpfsNetObj is our hosted ipfs network model
	HostedIpfsNetObj *models.HostedIPFSPrivateNetwork
	// DropObj is our airdrop model
	DropObj *models.Drop
	// TnsZoneObj is our tns zone model
	TnsZoneObj *models.Zone
	// TnsRecordObj is our tns record model
	TnsRecordObj *models.Record
)

Functions

func OpenDBConnection

func OpenDBConnection(opts DBOptions) (*gorm.DB, error)

OpenDBConnection is used to create a database connection

Types

type DBOptions

type DBOptions struct {
	User           string
	Password       string
	Address        string
	Port           string
	SSLModeDisable bool
}

DBOptions declares options for opening a database connection

type Manager added in v1.0.6

type Manager struct {
	DB     *gorm.DB
	Upload *models.UploadManager
}

Manager is used to manage databases

func Initialize

func Initialize(cfg *config.TemporalConfig, opts Options) (*Manager, error)

Initialize is used to init our connection to a database, and return a manager struct

func (*Manager) Close added in v1.0.6

func (dbm *Manager) Close() error

Close shuts down database connection

func (*Manager) RunMigrations added in v1.0.6

func (dbm *Manager) RunMigrations()

RunMigrations runs all migrations

type Options added in v1.0.6

type Options struct {
	RunMigrations  bool
	SSLModeDisable bool
	LogMode        bool
}

Options is used to configure a connection to the database

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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