Help us shape the future of Go! Take the 2026 Go Developer Survey

users

package
v1.20.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserIndexFilename           = "user-index.json"
	UserIndexCompressedFilename = UserIndexFilename + ".gz"
)

Variables

View Source
var (
	ErrIndexNotFound  = errors.New("user index not found")
	ErrIndexCorrupted = errors.New("user index corrupted")
)

Functions

func WriteUserIndex

func WriteUserIndex(ctx context.Context, bkt objstore.Bucket, idx *UserIndex) error

WriteUserIndex uploads the provided index to the storage.

Types

type Scanner

type Scanner interface {
	// ScanUsers returns the list of active, deleting and deleted users.
	// Both deleting and deleted users are marked for deletion. The difference is that
	// deleting users might still have data in the bucket, while deleted users don't.
	ScanUsers(ctx context.Context) (active, deleting, deleted []string, err error)
}

func NewShardedScanner

func NewShardedScanner(scanner Scanner, isOwned func(userID string) (bool, error), logger log.Logger) Scanner

type UserIndex

type UserIndex struct {
	Version   int   `json:"version"`
	UpdatedAt int64 `json:"updated_at"`

	ActiveUsers   []string `json:"active"`
	DeletingUsers []string `json:"deleting"`
	DeletedUsers  []string `json:"deleted"`
}

func ReadUserIndex

func ReadUserIndex(ctx context.Context, bkt objstore.InstrumentedBucket, logger log.Logger) (*UserIndex, error)

func (*UserIndex) GetUpdatedAt

func (idx *UserIndex) GetUpdatedAt() time.Time

type UserIndexUpdater

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

func (*UserIndexUpdater) UpdateUserIndex

func (u *UserIndexUpdater) UpdateUserIndex(ctx context.Context) error

Jump to

Keyboard shortcuts

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