sql

package
v0.3.730 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2019 License: Apache-2.0 Imports: 18 Imported by: 16

Documentation

Index

Constants

View Source
const (
	EnvDBPingMaxRetries = "FN_DS_DB_PING_MAX_RETRIES"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type SQLStore

type SQLStore struct {
	// contains filtered or unexported fields
}

SQLStore implements models.Datastore

func New

func New(ctx context.Context, u *url.URL) (*SQLStore, error)

New will open the db specified by url, create any tables necessary and return a models.Datastore safe for concurrent usage.

func (*SQLStore) Close

func (ds *SQLStore) Close() error

Close closes the database, releasing any open resources.

func (*SQLStore) GetAppByID

func (ds *SQLStore) GetAppByID(ctx context.Context, appID string) (*models.App, error)

func (*SQLStore) GetAppID

func (ds *SQLStore) GetAppID(ctx context.Context, appName string) (string, error)

func (*SQLStore) GetApps

func (ds *SQLStore) GetApps(ctx context.Context, filter *models.AppFilter) (*models.AppList, error)

GetApps retrieves an array of apps according to a specific filter.

func (*SQLStore) GetFnByID

func (ds *SQLStore) GetFnByID(ctx context.Context, fnID string) (*models.Fn, error)

func (*SQLStore) GetFns

func (ds *SQLStore) GetFns(ctx context.Context, filter *models.FnFilter) (*models.FnList, error)

func (*SQLStore) GetTrigger

func (ds *SQLStore) GetTrigger(ctx context.Context, appId, fnId, triggerName string) (*models.Trigger, error)

func (*SQLStore) GetTriggerByID

func (ds *SQLStore) GetTriggerByID(ctx context.Context, triggerID string) (*models.Trigger, error)

func (*SQLStore) GetTriggerBySource

func (ds *SQLStore) GetTriggerBySource(ctx context.Context, appId string, triggerType, source string) (*models.Trigger, error)

func (*SQLStore) GetTriggers

func (ds *SQLStore) GetTriggers(ctx context.Context, filter *models.TriggerFilter) (*models.TriggerList, error)

func (*SQLStore) InsertApp

func (ds *SQLStore) InsertApp(ctx context.Context, newApp *models.App) (*models.App, error)

func (*SQLStore) InsertFn

func (ds *SQLStore) InsertFn(ctx context.Context, newFn *models.Fn) (*models.Fn, error)

func (*SQLStore) InsertTrigger

func (ds *SQLStore) InsertTrigger(ctx context.Context, newTrigger *models.Trigger) (*models.Trigger, error)

func (*SQLStore) RemoveApp

func (ds *SQLStore) RemoveApp(ctx context.Context, appID string) error

func (*SQLStore) RemoveFn

func (ds *SQLStore) RemoveFn(ctx context.Context, fnID string) error

func (*SQLStore) RemoveTrigger

func (ds *SQLStore) RemoveTrigger(ctx context.Context, triggerId string) error

func (*SQLStore) Tx

func (ds *SQLStore) Tx(f func(*sqlx.Tx) error) error

func (*SQLStore) UpdateApp

func (ds *SQLStore) UpdateApp(ctx context.Context, newapp *models.App) (*models.App, error)

func (*SQLStore) UpdateFn

func (ds *SQLStore) UpdateFn(ctx context.Context, fn *models.Fn) (*models.Fn, error)

func (*SQLStore) UpdateTrigger

func (ds *SQLStore) UpdateTrigger(ctx context.Context, trigger *models.Trigger) (*models.Trigger, error)

Directories

Path Synopsis
Package dbhelper wraps SQL and specific capabilities of an SQL db
Package dbhelper wraps SQL and specific capabilities of an SQL db

Jump to

Keyboard shortcuts

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