repo

package
v0.0.0-...-9982bc2 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter

type Counter = int64

type HoursLeft

type HoursLeft = float64

type ID

type ID = string

type ReadActions

type ReadActions interface {
	GetStreak(context.Context, UserID, Type) ([]Streak, error)
	GetStreaksHistory(context.Context, UserID, Type, cursor.Cursor) ([]Streak, error)
}

type ReadWriteActions

type ReadWriteActions interface {
	ReadActions
	WriteActions
}

type Repo

type Repo interface {
	SingleRead() ReadActions
	SingleWrite() WriteActions
	ReadOnlyTx(context.Context, func(ctx context.Context, tx ReadActions) error) error
	ReadWriteTx(context.Context, func(ctx context.Context, tx ReadWriteActions) error) (time.Time, error)
}

type Streak

type Streak struct {
	ID        ID
	UserID    UserID
	Type      Type
	Counter   Counter
	HoursLeft HoursLeft
	UpdatedAt UpdatedAt `cursor:"offset,desc,default"`
}

type Type

type Type = int64

type UpdatedAt

type UpdatedAt = time.Time

type UserID

type UserID = string

type WriteActions

type WriteActions interface {
	UpsertStreak(context.Context, Streak) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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