userlist

package
v0.0.0-...-a3a6de1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoSuchUser = errors.New("no such user")
View Source
var ErrOptimisticLock = errors.New("lock error")

Functions

This section is empty.

Types

type DB

type DB interface {
	Get(ctx context.Context, name string) (*User, int64, error)
	Scan(ctx context.Context, f func(*User, int64)) error
	Put(ctx context.Context, user *User) (int64, error)
	Update(ctx context.Context, user *User, timestamp int64) (int64, error)
	Delete(ctx context.Context, name string, timestamp int64) error
}

type DynamoDB

type DynamoDB struct {
	// contains filtered or unexported fields
}

func NewDynamoDB

func NewDynamoDB(
	api dynamodbiface.DynamoDBAPI,
	table string,
) *DynamoDB

func (*DynamoDB) Delete

func (db *DynamoDB) Delete(ctx context.Context, email string, timestamp int64) error

func (*DynamoDB) Get

func (db *DynamoDB) Get(ctx context.Context, email string) (*User, int64, error)

func (*DynamoDB) Put

func (db *DynamoDB) Put(ctx context.Context, user *User) (int64, error)

func (*DynamoDB) Scan

func (db *DynamoDB) Scan(ctx context.Context, f func(*User, int64)) error

func (*DynamoDB) Update

func (db *DynamoDB) Update(ctx context.Context, user *User, timestamp int64) (int64, error)

type User

type User struct {
	Name     string
	AppCodes []string
}

Jump to

Keyboard shortcuts

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