Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUniqueViolation = &herodot.DefaultError{ CodeField: http.StatusConflict, StatusField: http.StatusText(http.StatusConflict), ErrorField: "Unable to insert or update resource because a resource with that value exists already", } ErrNoRows = &herodot.DefaultError{ CodeField: http.StatusNotFound, StatusField: http.StatusText(http.StatusNotFound), ErrorField: "Unable to locate the resource", } )
Functions ¶
func HandleError ¶
func HelpMessage ¶
func HelpMessage() string
func MigratorSQLCmd ¶
func MigratorSQLCmd(path, name string, logger logrus.FieldLogger, runners map[string]SchemaCreator) *cobra.Command
Types ¶
type Opt ¶ added in v0.0.14
type Opt func(*options)
func WithAllowRoot ¶ added in v0.0.14
func WithAllowRoot() Opt
WithAllowRoot will make it so that root spans will be created if a trace could not be found using opentracing's SpanFromContext method
func WithDistributedTracing ¶ added in v0.0.14
func WithDistributedTracing() Opt
WithDistributedTracing will make it so that a wrapped driver is used that supports the opentracing API
func WithOmitArgsFromTraceSpans ¶ added in v0.0.14
func WithOmitArgsFromTraceSpans() Opt
WithOmitArgsFromTraceSpans will make it so that query arguments are omitted from tracing spans
func WithRandomDriverName ¶ added in v0.0.20
func WithRandomDriverName() Opt
This option is specifically for writing tests as you can't register a driver with the same name more than once
type SQLConnection ¶
type SQLConnection struct { URL *url.URL L logrus.FieldLogger // contains filtered or unexported fields }
func NewSQLConnection ¶
func NewSQLConnection(db string, l logrus.FieldLogger, opts ...Opt) (*SQLConnection, error)
func (*SQLConnection) GetDatabase ¶
func (c *SQLConnection) GetDatabase() *sqlx.DB
func (*SQLConnection) GetDatabaseRetry ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.