infra

package
v0.0.0-...-70faa52 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyUser = fail.Errorf("user is empty")

ErrEmptyUser when context contains no user when trying to get one

Functions

func ConfigureCustomValidators

func ConfigureCustomValidators()

ConfigureCustomValidators sets up custom struct validators

func NewErrorReporter

func NewErrorReporter(dsn string) (usecases.ErrorReporter, error)

NewErrorReporter creates a new error reporter that sends errors to sentry

func NewJwtForTest

func NewJwtForTest(user *domain.User, key string) (string, error)

func NewRouter

func NewRouter(
	environment domain.Environment,
	port string,
	jwtSecret string,
	sessionCookieName string,
	corsAllowedOrigins []string,
	errorReporter usecases.ErrorReporter,
	routes ...services.Route,
) services.Router

NewRouter instantiates a router

func NewSQLHandler

func NewSQLHandler(db *RDB) rdb.SQLHandler

NewSQLHandler creates an interface to run queries on a database

func NewValidator

func NewValidator() usecases.Validator

NewValidator validates structs and possibly other stuff in the future

Types

type RDB

type RDB = sqlx.DB

RDB is a relational database connection pool

func NewRDB

func NewRDB(URL string, maxIdleConns, maxOpenConns int) (*RDB, error)

NewRDB creates a new relational database connection pool

Jump to

Keyboard shortcuts

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