dal

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: May 29, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package dal implements Data Access Layer using MySQL DB.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitMetrics

func InitMetrics(reg *prometheus.Registry)

InitMetrics must be called once before using this package. It registers and initializes metrics used by this package.

Types

type Ctx

type Ctx = context.Context

Ctx is a synonym for convenience.

type Repo

type Repo struct {
	*repo.Repo
}

Repo provides access to storage.

func New

func New(ctx Ctx, dir string, cfg *mysql.Config) (_ *Repo, err error)

New creates and returns new Repo. It will also run required DB migrations and connects to DB.

func (*Repo) Example

func (r *Repo) Example(ctx app.Ctx, userName dom.UserName) (res *app.Example, err error)

func (*Repo) IncExample

func (r *Repo) IncExample(ctx app.Ctx, userName dom.UserName) error

Jump to

Keyboard shortcuts

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