MCPcopy Create free account
hub / github.com/fnproject/fn / GetTriggerBySource

Method GetTriggerBySource

api/datastore/sql/sql.go:1040–1053  ·  view source on GitHub ↗
(ctx context.Context, appId string, triggerType, source string)

Source from the content-addressed store, hash-verified

1038}
1039
1040func (ds *SQLStore) GetTriggerBySource(ctx context.Context, appId string, triggerType, source string) (*models.Trigger, error) {
1041 var trigger models.Trigger
1042
1043 query := ds.db.Rebind(triggerIDSourceSelector)
1044 row := ds.db.QueryRowxContext(ctx, query, appId, triggerType, source)
1045
1046 err := row.StructScan(&trigger)
1047 if err == sql.ErrNoRows {
1048 return nil, models.ErrTriggerNotFound
1049 } else if err != nil {
1050 return nil, err
1051 }
1052 return &trigger, nil
1053}
1054
1055// Close closes the database, releasing any open resources.
1056func (ds *SQLStore) Close() error {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected