preferences

package
v1.10.20 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPreferencesNotFound = errors.New("preferences record not found")
)

Functions

func GetDefaultLocale

func GetDefaultLocale() language.Tag

GetDefaultLocale returns the default locale setting

Types

type Record

type Record struct {
	Id uint64

	DataContainerId user.DataContainerID

	Locale language.Tag

	LastUpdatedAt time.Time
}

func GetDefaultPreferences

func GetDefaultPreferences(id *user.DataContainerID) *Record

GetDefaultPreferences returns the default set of user preferences

func (*Record) Clone

func (r *Record) Clone() Record

func (*Record) CopyTo

func (r *Record) CopyTo(dst *Record)

func (*Record) Validate

func (r *Record) Validate() error

type Store

type Store interface {
	// Save saves a preferences record
	Save(ctx context.Context, record *Record) error

	// Get gets a a preference record by a data container. ErrPreferencesNotFound
	// is returned if no record exists.
	Get(ctx context.Context, id *user.DataContainerID) (*Record, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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