storage

package
v0.0.0-...-e3e9b0f Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommitWithError

type CommitWithError struct {
	Err error
}

func NewCommitWithError

func NewCommitWithError(err error) *CommitWithError

NewCommitWithError creates an error that can be returned in a pop transaction without rolling back the transaction. This should only be used in cases where you want the transaction to commit but return an error message to the user.

func (*CommitWithError) Cause

func (e *CommitWithError) Cause() error

func (*CommitWithError) Error

func (e *CommitWithError) Error() string

type Connection

type Connection struct {
	*pop.Connection
}

Connection is the interface a storage provider must implement.

func Dial

func Dial(config *conf.GlobalConfiguration) (*Connection, error)

Dial will connect to that storage engine

func (*Connection) Transaction

func (c *Connection) Transaction(fn func(*Connection) error) error

func (*Connection) UpdateOnly

func (conn *Connection) UpdateOnly(model interface{}, includeColumns ...string) error

func (*Connection) WithContext

func (c *Connection) WithContext(ctx context.Context) *Connection

WithContext returns a new connection with an updated context. This is typically used for tracing as the context contains trace span information.

type NullString

type NullString string

func (*NullString) Scan

func (s *NullString) Scan(value interface{}) error

func (NullString) String

func (s NullString) String() string

func (NullString) Value

func (s NullString) Value() (driver.Value, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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