Documentation ¶
Index ¶
- Variables
- func AuthInjectorTestHandler(userID string) fiber.Handler
- func BuildRequest(method, url, body string) *http.Request
- func CreateMnemonic(addr []byte) (string, error)
- func CursorToID(cur string) (int, error)
- func GenerateDCNNode() []byte
- func GenerateWallet() (*ecdsa.PrivateKey, *common.Address, error)
- func GetAftermarketDeviceImageUrl(baseURL string, tokenID int) string
- func GetVehicleImageUrl(baseURL string, tokenID int) string
- func IDToCursor(id int) string
- func IntToBytes(intVal int) []byte
- func Logger() *zerolog.Logger
- func StartContainerDatabase(ctx context.Context, t *testing.T, migrationsDirRelPath string) (db.Store, testcontainers.Container)
- func TruncateTables(db *sql.DB, t *testing.T)
- func ValidateFirstLast(first, last *int, maxPageSize int) (int, error)
- func WithSchema(tableName string) string
- type PaginationHelper
Constants ¶
This section is empty.
Variables ¶
View Source
var DBSettings = db.Settings{
Name: "identity_api",
Host: "localhost",
Port: "6669",
User: "postgres",
Password: "postgres",
MaxOpenConnections: 2,
MaxIdleConnections: 2,
}
Functions ¶
func AuthInjectorTestHandler ¶
func AuthInjectorTestHandler(userID string) fiber.Handler
AuthInjectorTestHandler injects fake jwt with sub
func BuildRequest ¶
func CreateMnemonic ¶
func CursorToID ¶
func GenerateDCNNode ¶
func GenerateDCNNode() []byte
func GenerateWallet ¶
func GenerateWallet() (*ecdsa.PrivateKey, *common.Address, error)
func GetAftermarketDeviceImageUrl ¶ added in v0.1.8
func GetVehicleImageUrl ¶ added in v0.1.7
func IDToCursor ¶
func IntToBytes ¶
func StartContainerDatabase ¶
func StartContainerDatabase(ctx context.Context, t *testing.T, migrationsDirRelPath string) (db.Store, testcontainers.Container)
StartContainerDatabase starts postgres container with default test settings, and migrates the db. Caller must terminate container.
func TruncateTables ¶
TruncateTables truncates tables for the test db, useful to run as teardown at end of each DB dependent test.
func ValidateFirstLast ¶ added in v0.1.7
func WithSchema ¶
Types ¶
type PaginationHelper ¶
type PaginationHelper[T any] struct{}
func (PaginationHelper[T]) DecodeCursor ¶
func (p PaginationHelper[T]) DecodeCursor(cursor string) (*T, error)
func (PaginationHelper[T]) EncodeCursor ¶
func (p PaginationHelper[T]) EncodeCursor(cursor T) (string, error)
Click to show internal directories.
Click to hide internal directories.