settings

package
v1.23.1 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Module(
	"settings",
	fx.Decorate(func(log *zap.Logger) *zap.Logger {
		return log.Named("settings")
	}),
	fx.Provide(
		newRepository,
		fx.Private,
	),
	fx.Provide(
		NewService,
	),
)

Functions

func Migrate

func Migrate(db *gorm.DB) error

Types

type DeviceSettings

type DeviceSettings struct {
	UserID   string         `gorm:"primaryKey;not null;type:varchar(32)"`
	Settings map[string]any `gorm:"not null;type:json;serializer:json"`

	User models.User `gorm:"foreignKey:UserID;constraint:OnDelete:CASCADE"`

	models.TimedModel
}

type Service

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

func NewService

func NewService(params ServiceParams) *Service

func (*Service) GetSettings

func (s *Service) GetSettings(userID string, public bool) (map[string]any, error)

func (*Service) ReplaceSettings

func (s *Service) ReplaceSettings(userID string, settings map[string]any) (map[string]any, error)

func (*Service) UpdateSettings

func (s *Service) UpdateSettings(userID string, settings map[string]any) (map[string]any, error)

type ServiceParams

type ServiceParams struct {
	fx.In

	Repository *repository

	Logger *zap.Logger

	PushSvc *push.Service
}

Jump to

Keyboard shortcuts

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