Documentation ¶
Overview ¶
Package dbtools provides tools to help with interacting with the database, including all of our utilities for database integration testing
Index ¶
- func ComponentTypeIDFromName(name string) (string, error)
- func Decrypt(ctx context.Context, keeper *secrets.Keeper, base64str string) (string, error)
- func Encrypt(ctx context.Context, keeper *secrets.Keeper, str string) (string, error)
- func RegisterHooks()
- func SetupComponentTypes(ctx context.Context, db *sqlx.DB) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComponentTypeIDFromName ¶
ComponentTypeIDFromName expects the name of the component (as defined in bmc-toolbox) and will return the internal database ID for that name.
func Decrypt ¶
Decrypt provides a wrapper to handle decrypting a base64 encoded string with the secrets keeper
func Encrypt ¶
Encrypt provides a wrapper to handle encrypting a string with the secrets keeper and returns it already base64 encoded
func RegisterHooks ¶
func RegisterHooks()
RegisterHooks adds any hooks that are configured to the models library
func SetupComponentTypes ¶
SetupComponentTypes upserts all known component types to the database. Despite the descriptor, in the database the Name field of the component type is the verbatim value of the string, and the Slug is computed as a lower-case english-localized variant.
Types ¶
This section is empty.