settings

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultRegion = &commonpb.Region{Value: "usd"}
	DefaultLocale = &commonpb.Locale{Value: "en"}

	ErrNotFound = errors.New("not found")
)

Functions

This section is empty.

Types

type Server

type Server struct {
	settingspb.UnimplementedSettingsServer
	// contains filtered or unexported fields
}

func NewServer

func NewServer(log *zap.Logger, authz auth.Authorizer, store Store) *Server

type Settings

type Settings struct {
	Region *commonpb.Region
	Locale *commonpb.Locale
}

type Store

type Store interface {
	// GetSettings returns the settings for a user, or ErrNotFound.
	GetSettings(ctx context.Context, userID *commonpb.UserId) (*Settings, error)

	// SetRegion sets the region for a user, provided they exist.
	//
	// ErrNotFound is returned if the user does not exist.
	SetRegion(ctx context.Context, userID *commonpb.UserId, region *commonpb.Region) error

	// SetLocale sets the locale for a user, provided they exist.
	//
	// ErrNotFound is returned if the user does not exist.
	SetLocale(ctx context.Context, userID *commonpb.UserId, locale *commonpb.Locale) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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