Documentation ¶
Index ¶
- Constants
- Variables
- func ExecDelete(ctx context.Context, database Database, query string, args ...interface{}) (int64, error)
- func ExecInsert(ctx context.Context, database Database, query string, args ...interface{}) (int, error)
- func GetEnvWithDefault(key, defaultValue string) string
- func Migrate() error
- type Database
- type GarbanzoStore
- func (GarbanzoStore) Create(ctx context.Context, database Database, garbanzo data.Garbanzo) (int, error)
- func (GarbanzoStore) DeleteByAPIUUIDAndOctoName(ctx context.Context, database Database, apiUUID uuid.UUID, octoName string) error
- func (GarbanzoStore) DeleteByOctoId(ctx context.Context, database Database, octoId int) error
- func (GarbanzoStore) FetchByAPIUUIDAndOctoName(ctx context.Context, database Database, apiUUID uuid.UUID, octoName string) (data.Garbanzo, error)
- func (GarbanzoStore) FetchByOctoName(ctx context.Context, database Database, octoName string) ([]data.Garbanzo, error)
- type OctoStore
- func (OctoStore) Create(ctx context.Context, database Database, octo data.Octo) (int, error)
- func (OctoStore) DeleteById(ctx context.Context, database Database, id int) error
- func (OctoStore) FetchAll(ctx context.Context, database Database) ([]data.Octo, error)
- func (OctoStore) FetchByName(ctx context.Context, database Database, name string, selectForUpdate bool) (data.Octo, error)
Constants ¶
View Source
const OrgContextKey = "org"
Variables ¶
View Source
var (
ErrNotFound = errors.New("identified data not found")
)
Functions ¶
func ExecDelete ¶
func ExecInsert ¶
func GetEnvWithDefault ¶
Types ¶
type Database ¶
type Database interface { Exec(ctx context.Context, query string, args ...interface{}) (result sql.Result, err error) Query(ctx context.Context, query string, args ...interface{}) (rows *sql.Rows, err error) QueryRow(ctx context.Context, query string, args ...interface{}) (row *sql.Row) BeginTx(ctx context.Context) (database Database, err error) Commit() (err error) Rollback() (err error) }
type GarbanzoStore ¶
type GarbanzoStore struct{}
func (GarbanzoStore) DeleteByAPIUUIDAndOctoName ¶
func (GarbanzoStore) DeleteByOctoId ¶
func (GarbanzoStore) FetchByAPIUUIDAndOctoName ¶
func (GarbanzoStore) FetchByOctoName ¶
Click to show internal directories.
Click to hide internal directories.