dbtools

package
v1.20.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package dbtools provides tools to help with interacting with the database, including all of our utilities for database integration testing

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComponentTypeIDFromName

func ComponentTypeIDFromName(name string) (string, error)

ComponentTypeIDFromName expects the name of the component (as defined in bmc-toolbox) and will return the internal database ID for that name.

func Decrypt

func Decrypt(ctx context.Context, keeper *secrets.Keeper, base64str string) (string, error)

Decrypt provides a wrapper to handle decrypting a base64 encoded string with the secrets keeper

func Encrypt

func Encrypt(ctx context.Context, keeper *secrets.Keeper, str string) (string, error)

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

func SetupComponentTypes(ctx context.Context, db *sqlx.DB) error

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.

Jump to

Keyboard shortcuts

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