gormconv

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, converter unidb.Converter)

Register registers the gorm converter

Types

type AnyConverter

type AnyConverter struct{}

func (AnyConverter) Convert

func (a AnyConverter) Convert(err error) *unidb.Error

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(dialectName string) (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) (dbErr *unidb.Error)

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

Directories

Path Synopsis
dialects

Jump to

Keyboard shortcuts

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