database

package module
v2.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2019 License: MIT Imports: 7 Imported by: 8

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

This section is empty.

Functions

This section is empty.

Types

type LogLevel

type LogLevel string

LogLevel indicates different logging levels

const (
	// LogLevelInfo denotes info-level logging
	LogLevelInfo LogLevel = "info"

	// LogLevelDebug denotes debug-level logging
	LogLevelDebug LogLevel = "debug"
)

type Logger

type Logger interface{ Print(...interface{}) }

Logger defines the database's logging interface

type Manager added in v1.0.6

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

Manager is used to manage databases

func New

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

New 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
	Logger         Logger
}

Options is used to configure a connection to the database

type PrintLogger

type PrintLogger struct {
	// contains filtered or unexported fields
}

PrintLogger wraps a single logFunc to implement the Logger interface

func NewZapLogger

func NewZapLogger(level LogLevel, l *zap.SugaredLogger) *PrintLogger

NewZapLogger wraps a zap logger in a PrintLogger

func (*PrintLogger) Print

func (p *PrintLogger) Print(args ...interface{})

Print logs the given message

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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