repository

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database added in v0.0.17

type Database interface {
	InsertTask(ctx context.Context, task *model.Task) error
	SelectTaskList(ctx context.Context, id model.UserID) (model.TaskList, error)
	InsertUser(ctx context.Context, user *model.User) error
	SelectUser(ctx context.Context, name string) (*model.User, error)
}

type KVS added in v0.0.19

type KVS interface {
	SetUserID(ctx context.Context, key string, id model.UserID, ttl int64) error
	GetUserID(ctx context.Context, key string) (model.UserID, error)
}

type SimpleDB

type SimpleDB struct {
	database.Database
}

repository.Repository の実装

func NewSimpleDB added in v0.0.14

func NewSimpleDB(db database.Database) *SimpleDB

func (*SimpleDB) InsertTask added in v0.0.13

func (sd *SimpleDB) InsertTask(ctx context.Context, task *model.Task) error

func (*SimpleDB) InsertUser added in v0.0.16

func (sd *SimpleDB) InsertUser(ctx context.Context, user *model.User) error

func (*SimpleDB) SelectTaskList added in v0.0.13

func (sd *SimpleDB) SelectTaskList(ctx context.Context, id model.UserID) (model.TaskList, error)

func (*SimpleDB) SelectUser added in v0.0.17

func (sd *SimpleDB) SelectUser(ctx context.Context, name string) (*model.User, error)

type SimpleKVS added in v0.0.19

type SimpleKVS struct {
	kvs.KVS
}

repository.Memory の実装

func NewSimpleKVS added in v0.0.19

func NewSimpleKVS(k kvs.KVS) *SimpleKVS

func (*SimpleKVS) GetUserID added in v0.0.19

func (k *SimpleKVS) GetUserID(ctx context.Context, key string) (model.UserID, error)

func (*SimpleKVS) SetUserID added in v0.0.19

func (k *SimpleKVS) SetUserID(ctx context.Context, key string, id model.UserID, ttl int64) error

Directories

Path Synopsis
kvs

Jump to

Keyboard shortcuts

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