Documentation ¶
Index ¶
- Constants
- func BuildSubscriber(row pgx.CollectableRow) (subscriber *models.Subscriber, err error)
- func GenerateCSPRNG(tokenLen int) (csprng string, err error)
- func GenerateConfirmationLink(c context.Context, tx pgx.Tx, subscriberEmail *models.SubscriberEmail) (confirmation string, err error)
- func HandleError(c *gin.Context, id string, e error, response string, status int)
- func HealthCheck(c *gin.Context)
- func StoreToken(c context.Context, tx pgx.Tx, id string, token string) (err error)
- type DatabaseHandler
- type DatabaseInterface
- type Loader
Constants ¶
View Source
const BaseURL = "http://localhost:8000"
TODO switch to cfg baseURL
Variables ¶
This section is empty.
Functions ¶
func BuildSubscriber ¶
func BuildSubscriber(row pgx.CollectableRow) (subscriber *models.Subscriber, err error)
func GenerateCSPRNG ¶
func HandleError ¶
func HealthCheck ¶
Types ¶
type DatabaseHandler ¶
type DatabaseHandler struct { DB DatabaseInterface Context *context.Context }
func NewDatabaseHandler ¶
func NewDatabaseHandler(database DatabaseInterface) *DatabaseHandler
type DatabaseInterface ¶
type DatabaseInterface interface { Exec(c context.Context, sql string, arguments ...interface{}) (pgconn.CommandTag, error) Query(c context.Context, sql string, args ...interface{}) (pgx.Rows, error) QueryRow(c context.Context, sql string, args ...interface{}) pgx.Row Begin(c context.Context) (pgx.Tx, error) }
Click to show internal directories.
Click to hide internal directories.