gormconv

package
v0.0.0-...-3215105 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GORMConverter

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

GORMConverter defines error converter for multiple databases drivers used by the 'gorm' package. Implements 'Converter' interface.

func New

func New(db *gorm.DB) (conv *GORMConverter, err error)

New creates new *GORMConverter. On the base of the *gorm.DB argument it recognise given gorm.Dialect on the base of the dialect the function recognise the appropiate error converter. returns error if the nil pointer provided or unsupported db.Dialect

func (*GORMConverter) Convert

func (g *GORMConverter) Convert(err error) *dberrors.Error

Convert implements dberrors.Converter Converts provided argument error into *dberrors.Error type

Jump to

Keyboard shortcuts

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