setting

package
v0.9.13 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DvAdminSecretKey = "dv_admin_secret_key"

	ProcessingURL       = "processing_url"
	ProcessingClientID  = "processing_client_id"
	ProcessingClientKey = "processing_client_key"

	RegistrationState = "registration_state"

	MailerState           = "mailer_state"
	MailerProtocol        = "mailer_protocol"
	MailerAddress         = "mailer_address"
	MailerSender          = "mailer_sender"
	MailerUsername        = "mailer_username"
	MailerPassword        = "mailer_password"
	MailerEncryption      = "mailer_encryption"
	MerchantDomain        = "merchant_domain"
	MerchantPayFormDomain = "merchant_pay_form_domain"

	NotificationSender = "notification_sender"
	AnonymousTelemetry = "anonymous_telemetry"
)

Root settings

View Source
const (
	ExternalWalletsListNotification = "external_wallet_email_notification"
	UserCryptoReceiptNotification   = "user_crypto_receipt_email_notification"
)
View Source
const (
	FlagValueEnabled  = "enabled"
	FlagValueDisabled = "disabled"
)
View Source
const (
	MailerEncryptionTypeNone = "none"
	MailerEncryptionTypeTLS  = "tls"
)
View Source
const (
	NotificationSenderInternal = "internal"
	NotificationSenderDVNet    = "dv_net"
)
View Source
const (
	FlagValueCompleted   = "completed"
	FlagValueIncompleted = "incompleted"
)
View Source
const (
	MailerSettingsChanged = "MailerSettingChanged"
)
View Source
const (
	NotificationSenderChanged = "NotificationSenderChanged"
)
View Source
const (
	QuickStartGuideStatus = "quick_start_guide_status"
)
View Source
const (
	RootSettingsChanged = "SettingChanged"
)
View Source
const (
	TransferStatusSystemSuspended string = "system_suspended"
)
View Source
const (
	TransferType = "transfer_type"
)

TransferType Tron settings

View Source
const (
	TransfersStatus = "transfers_status"
)

TransfersStatus Common settings

View Source
const (
	WithdrawFromProcessing = "withdraw_from_processing"
)

Variables

View Source
var SensitiveSettings = []string{
	DvAdminSecretKey,
}

Functions

This section is empty.

Types

type ByName

type ByName []Dto

func (ByName) Len

func (a ByName) Len() int

func (ByName) Less

func (a ByName) Less(i, j int) bool

func (ByName) Swap

func (a ByName) Swap(i, j int)

type Dto

type Dto struct {
	Name                          string   `json:"name"`
	Value                         *string  `json:"value"`
	IsEditable                    bool     `json:"is_editable"`
	TwoFactorVerificationRequired bool     `json:"two_factor_verification_required"`
	AvailableValues               []string `json:"available_values"`
}

type FlagValue

type FlagValue string

type GetByModelParams

type GetByModelParams = repo_settings.GetByModelParams

type IModelSetting

type IModelSetting interface {
	ModelID() uuid.NullUUID
	ModelName() *string
}

type IRootSettings

type IRootSettings interface {
	GetRootSetting(ctx context.Context, name string) (*models.Setting, error)
	SetRootSetting(ctx context.Context, name string, value string) (*models.Setting, error)
	GetRootSettings(ctx context.Context) ([]*models.Setting, error)
	GetRootSettingsByNames(ctx context.Context, names []string) ([]*models.Setting, error)
	GetRootSettingsList(ctx context.Context) ([]Dto, error)
	RemoveRootSetting(ctx context.Context, name string) error
	GetMailerSettings(ctx context.Context) (*settings.MailerSettings, error)
}

type ISettingService

type ISettingService interface {
	IUserSettings
	IRootSettings
	IStoreSettings

	Is2faRequired(name string) bool
}

func New

func New(
	cfg *config.Config,
	storage storage.IStorage,
	cache cache.ICache,
	eventListener event.IListener,
	log logger.Logger,
) ISettingService

type IStoreSettings added in v0.9.6

type IStoreSettings interface {
	GetStoreModelSetting(ctx context.Context, name string, model IModelSetting) (*models.Setting, error)
	SetStoreModelSetting(ctx context.Context, dto UpdateDTO, opts ...repos.Option) error
	GetAvailableStoreModelSettings(ctx context.Context, model IModelSetting) ([]Dto, error)
	RemoveStoreModelSetting(ctx context.Context, store *models.Store, name string) error
}

type IUserSettings

type IUserSettings interface {
	GetModelSetting(ctx context.Context, name string, model IModelSetting) (*models.Setting, error)
	SetModelSetting(ctx context.Context, dto UpdateDTO, option ...repos.Option) error
	GetAvailableModelSettings(ctx context.Context, model IModelSetting) ([]Dto, error)
	RemoveSetting(ctx context.Context, user *models.User, name string) error
}

type MailerSettingChangedEvent

type MailerSettingChangedEvent struct {
	SettingName  string
	SettingValue string
}

func (MailerSettingChangedEvent) String

func (e MailerSettingChangedEvent) String() string

func (MailerSettingChangedEvent) Type

type NotificationSenderChangedEvent

type NotificationSenderChangedEvent struct {
	NewValue string
}

func (NotificationSenderChangedEvent) String

func (NotificationSenderChangedEvent) Type

type RemoveDTO

type RemoveDTO struct {
	Name string
	Code int
}

type RootSettingChangedEvent

type RootSettingChangedEvent struct {
	SettingName  string
	SettingValue string
}

func (RootSettingChangedEvent) String

func (e RootSettingChangedEvent) String() string

func (RootSettingChangedEvent) Type

type Service

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

func (*Service) GetAvailableModelSettings

func (s *Service) GetAvailableModelSettings(ctx context.Context, model IModelSetting) ([]Dto, error)

func (*Service) GetAvailableStoreModelSettings added in v0.9.6

func (s *Service) GetAvailableStoreModelSettings(ctx context.Context, model IModelSetting) ([]Dto, error)

func (*Service) GetMailerSettings

func (s *Service) GetMailerSettings(ctx context.Context) (*settings.MailerSettings, error)

func (*Service) GetModelSetting

func (s *Service) GetModelSetting(ctx context.Context, name string, model IModelSetting) (*models.Setting, error)

func (*Service) GetRootSetting

func (s *Service) GetRootSetting(ctx context.Context, name string) (*models.Setting, error)

func (*Service) GetRootSettings

func (s *Service) GetRootSettings(ctx context.Context) ([]*models.Setting, error)

func (*Service) GetRootSettingsByNames

func (s *Service) GetRootSettingsByNames(ctx context.Context, names []string) ([]*models.Setting, error)

func (*Service) GetRootSettingsList

func (s *Service) GetRootSettingsList(ctx context.Context) ([]Dto, error)

func (*Service) GetStoreModelSetting added in v0.9.6

func (s *Service) GetStoreModelSetting(ctx context.Context, name string, model IModelSetting) (*models.Setting, error)

func (*Service) Is2faRequired

func (s *Service) Is2faRequired(name string) bool

func (*Service) RemoveRootSetting

func (s *Service) RemoveRootSetting(ctx context.Context, name string) error

func (*Service) RemoveSetting

func (s *Service) RemoveSetting(ctx context.Context, user *models.User, name string) error

func (*Service) RemoveStoreModelSetting added in v0.9.6

func (s *Service) RemoveStoreModelSetting(ctx context.Context, store *models.Store, name string) error

func (*Service) SetModelSetting

func (s *Service) SetModelSetting(ctx context.Context, dto UpdateDTO, opts ...repos.Option) error

func (*Service) SetRootSetting

func (s *Service) SetRootSetting(ctx context.Context, name, value string) (*models.Setting, error)

func (*Service) SetStoreModelSetting added in v0.9.6

func (s *Service) SetStoreModelSetting(ctx context.Context, dto UpdateDTO, opts ...repos.Option) error

type TransferTypeValue

type TransferTypeValue string
const (
	TransferByBurnTRX       TransferTypeValue = "burntrx"
	TransferByResource      TransferTypeValue = "resources"
	TransferByCloudDelegate TransferTypeValue = "cloud_delegate"
)

func (TransferTypeValue) String

func (o TransferTypeValue) String() string

type UpdateDTO

type UpdateDTO struct {
	Name  string
	Value string
	Model IModelSetting
}

type UpdateDto

type UpdateDto struct {
	Name  string
	Value string
}

Jump to

Keyboard shortcuts

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