Documentation ¶
Overview ¶
Package gorm is the fantastic ORM library for Golang, aims to be developer friendly.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrRecordNotFound record not found error ErrRecordNotFound = gorm.ErrRecordNotFound // ErrInvalidTransaction invalid transaction when you are trying to `Commit` or `Rollback` ErrInvalidTransaction = gorm.ErrInvalidTransaction // ErrNotImplemented not implemented ErrNotImplemented = gorm.ErrNotImplemented // ErrMissingWhereClause missing where clause ErrMissingWhereClause = gorm.ErrMissingWhereClause // ErrUnsupportedRelation unsupported relations ErrUnsupportedRelation = gorm.ErrUnsupportedRelation // ErrPrimaryKeyRequired primary keys required ErrPrimaryKeyRequired = gorm.ErrPrimaryKeyRequired // ErrModelValueRequired model value required ErrModelValueRequired = gorm.ErrModelValueRequired // ErrInvalidData unsupported data ErrInvalidData = gorm.ErrInvalidData // ErrUnsupportedDriver unsupported driver ErrUnsupportedDriver = gorm.ErrUnsupportedDriver // ErrRegistered registered ErrRegistered = gorm.ErrRegistered // ErrInvalidField invalid field ErrInvalidField = gorm.ErrInvalidField // ErrEmptySlice empty slice found ErrEmptySlice = gorm.ErrEmptySlice // ErrDryRunModeUnsupported dry run mode unsupported ErrDryRunModeUnsupported = gorm.ErrDryRunModeUnsupported )
Functions ¶
This section is empty.
Types ¶
type Model ¶
Model a basic GoLang struct which includes the following fields: ID, CreatedAt, UpdatedAt, DeletedAt It may be embedded into your model or you may build your own model without it
type User struct { gorm.Model }
type Option ¶
type Option interface {
Apply(*config)
}
Option applies a configuration to the given config.
func WithMeterProvider ¶
func WithMeterProvider(mp metric.MeterProvider) Option
WithMeterProvider specifies a meter provider to use for creating a meter. If none is specified, the global provider is used.
func WithOperationName ¶
WithOperationName specifies a operation name. If none is specified, the default operation name is used
func WithSpanNameFormatter ¶
func WithSpanNameFormatter(f SpanNameFormatter) Option
WithSpanNameFormatter specifies a formatter to used to format span names. If none is specified, the default SpanNameFormatter is used
func WithTracerProvider ¶
func WithTracerProvider(tp trace.TracerProvider) Option
WithTracerProvider specifies a tracer provider to use for creating a tracer. If none is specified, the global provider is used.
type OptionFunc ¶
type OptionFunc func(c *config)
OptionFunc provides a convenience wrapper for simple Options that can be represented as functions.
func (OptionFunc) Apply ¶
func (o OptionFunc) Apply(c *config)
Apply will apply the option to the config.
type SpanNameFormatter ¶
SpanNameFormatter creates a custom span name from the operation and db object.