storage

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package storage owns the database connection and the store built on it. It exports its contract, Store and User, and its Module; the connection and the implementation are private. Keys are types, so a type only this package can name is a service only this package can resolve.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Module

func Module(s *di.Scope)

Module registers the package's services. Constructors are handed over as they are; the hooks are typed on what they receive. The Store key is served by the private constructor, whose result is assignable to it.

Types

type Store

type Store interface {
	Find(ctx context.Context, id string) (User, error)
	Ping(ctx context.Context) error
}

Store is what the rest of the application depends on. Handlers take the interface; the container serves whatever is registered for it.

type User

type User struct{ ID, Name string }

Jump to

Keyboard shortcuts

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