dao

package
v0.0.0-...-837eb61 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Transact

func Transact(db *DB, txFunc func(*DBTrans) error) error

Transact wraps your calls in a transaction. If the call should fail with an error it will perform a rollback. Otherwise the transaction will be committed.

Types

type DB

type DB struct {
	*gorp.DbMap
}

func New

func New(conf *config.PostgresConfig) (*DB, error)

func (*DB) AddDestination

func (db *DB) AddDestination(destination *datafeed.AddDestinationRequest) (int64, error)

func (*DB) DeleteDestination

func (db *DB) DeleteDestination(delete *datafeed.DeleteDestinationRequest) error

func (*DB) EnableDestination

func (db *DB) EnableDestination(ctx context.Context, destination *datafeed.UpdateDestinationEnableRequest) error

func (*DB) GetDestination

func (*DB) ListDBDestinations

func (db *DB) ListDBDestinations() ([]Destination, error)

func (*DB) ListDestinations

func (db *DB) ListDestinations() (*datafeed.ListDestinationResponse, error)

func (*DB) UpdateDestination

func (db *DB) UpdateDestination(destination *datafeed.UpdateDestinationRequest) error

type DBTrans

type DBTrans struct {
	*gorp.Transaction
}

type Destination

type Destination struct {
	ID               int64  `db:"id"`
	Name             string `db:"name"`
	URL              string `db:"url"`
	Secret           string `db:"secret"`
	Services         string `db:"services"`
	IntegrationTypes string `db:"integration_types"`
	MetaData         string `db:"meta_data"`
	Enable           bool   `db:"enable"`
}

Jump to

Keyboard shortcuts

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