storage

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: MIT Imports: 6 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

This section is empty.

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
	Stats    stats.Tracker
}

GreetingSaver saves greetings to database.

func (*GreetingSaver) ClearGreetings

func (gs *GreetingSaver) ClearGreetings(ctx context.Context) (int, error)

ClearGreetings removes all entries.

func (*GreetingSaver) GreetingClearer

func (gs *GreetingSaver) GreetingClearer() greeting.Clearer

GreetingClearer implements service provider.

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.

Directories

Path Synopsis
Package mysql provides migrations.
Package mysql provides migrations.
Package sqlite provides migrations.
Package sqlite provides migrations.

Jump to

Keyboard shortcuts

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