customsettings

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: May 18, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomSetting

type CustomSetting struct {
	SettingID string `db:"setting_id" json:"settingID"`
	// Value will be returned in Base64 from PostgreSQL
	Value  interface{} `db:"value" json:"value"`
	Public bool        `db:"public" json:"public"`
}

type CustomSettingEditDTO

type CustomSettingEditDTO struct {
	// Value will be returned in Base64 from PostgreSQL
	Value  string `db:"value" json:"value"`
	Public bool   `db:"public" json:"public"`
}

type Repo

type Repo interface {
	ListCustomSettings(ctx context.Context) ([]CustomSetting, error)
	GetCustomSetting(ctx context.Context, settingID string) (CustomSetting, error)
	AddCustomSetting(ctx context.Context, customSetting CustomSetting) (CustomSetting, error)
	EditCustomSetting(ctx context.Context, settingID string, customSettingEdit CustomSettingEditDTO) (CustomSetting, error)
	DeleteCustomSetting(ctx context.Context, settingID string) error
}

func NewStore

func NewStore(db *sqlx.DB) Repo

NewStore creates a new store

type Store

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

Store contains our dependency

func (*Store) AddCustomSetting

func (s *Store) AddCustomSetting(ctx context.Context, customSetting CustomSetting) (CustomSetting, error)

func (*Store) DeleteCustomSetting

func (s *Store) DeleteCustomSetting(ctx context.Context, settingID string) error

func (*Store) EditCustomSetting

func (s *Store) EditCustomSetting(ctx context.Context, settingID string, customSettingEdit CustomSettingEditDTO) (CustomSetting, error)

func (*Store) GetCustomSetting

func (s *Store) GetCustomSetting(ctx context.Context, settingID string) (CustomSetting, error)

func (*Store) ListCustomSettings

func (s *Store) ListCustomSettings(ctx context.Context) ([]CustomSetting, error)

Jump to

Keyboard shortcuts

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