config

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGenericType

func GetGenericType(x any) string

Types

type Config

type Config[T TenantId, V any] struct {
	EntityId T              `json:"entity_id" db:"entityId"`
	Key      string         `json:"key" db:"configKey"`
	Value    ConfigValue[V] `json:"value" db:"-"`
}

func NewConfig

func NewConfig[T TenantId, V any](value *V) *Config[T, V]

func (*Config[T, V]) GetKey

func (c *Config[T, V]) GetKey() string

type ConfigValue

type ConfigValue[V any] struct {
	Val *V `json:"value" db:"value"`
}

func (*ConfigValue[V]) Scan

func (c *ConfigValue[V]) Scan(src interface{}) error

func (ConfigValue[V]) Value

func (c ConfigValue[V]) Value() (driver.Value, error)

type TenantId

type TenantId interface {
	int | string
}

Jump to

Keyboard shortcuts

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