handle.go

 1package store
 2
 3import (
 4	"context"
 5
 6	"github.com/charmbracelet/soft-serve/pkg/db"
 7	"github.com/charmbracelet/soft-serve/pkg/db/models"
 8)
 9
10// HandleStore is a store for username handles.
11type HandleStore interface {
12	GetHandleByID(ctx context.Context, h db.Handler, id int64) (models.Handle, error)
13	GetHandleByHandle(ctx context.Context, h db.Handler, handle string) (models.Handle, error)
14	GetHandleByUserID(ctx context.Context, h db.Handler, userID int64) (models.Handle, error)
15	ListHandlesForIDs(ctx context.Context, h db.Handler, ids []int64) ([]models.Handle, error)
16	UpdateHandle(ctx context.Context, h db.Handler, id int64, handle string) error
17	CreateHandle(ctx context.Context, h db.Handler, handle string) (int64, error)
18	DeleteHandle(ctx context.Context, h db.Handler, id int64) error
19}