storage

package
v0.0.0-...-97be428 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package storage provides database-related implementations.

Index

Constants

View Source
const GreetingsTable = "greetings"

GreetingsTable is the name of the table.

Variables

View Source
var Migrations embed.FS

Migrations provide database migrations.

Functions

This section is empty.

Types

type GreetingRow

type GreetingRow struct {
	ID        int       `db:"id,omitempty"`
	Message   string    `db:"message"`
	CreatedAt time.Time `db:"created_at"`
}

GreetingRow describes database mapping.

type GreetingSaver

type GreetingSaver struct {
	Upstream greeting.Maker
	Storage  *sqluct.Storage
}

GreetingSaver saves greetings to database.

func (*GreetingSaver) GreetingMaker

func (gs *GreetingSaver) GreetingMaker() greeting.Maker

GreetingMaker implements service provider.

func (*GreetingSaver) Hello

func (gs *GreetingSaver) Hello(ctx context.Context, params greeting.Params) (string, error)

Hello makes a greeting with Upstream and stores it in database before returning.

Jump to

Keyboard shortcuts

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