Documentation
¶
Index ¶
- func BuildQueryLike(ctx context.Context, tx *sql.Tx, data any, cond string) (str string, err error)
- func GenerateSQLConditions(data any) (strs []string)
- func QueryContext[D Database, T Entity](ctx context.Context, db D, baseQuery string, queryParams []interface{}, ...) (t []T, err error)
- func QueryLike[T Entity](ctx context.Context, basQuery string, tx *sql.Tx, ...) (t []T, err error)
- func StructToInterfaceScan(v interface{}) []interface{}
- type AesKeySize
- type Crypto
- func (c *Crypto) AESFunc() func() (core.PrimitiveAES, error)
- func (c *Crypto) AESWithKeyFunc(key []byte) func() (core.PrimitiveAES, error)
- func (c *Crypto) BindHeap(entity any) (err error)
- func (c *Crypto) Decrypt(alg aesx.AesAlg) aesx.AES[string, core.PrimitiveAES]
- func (c *Crypto) Encrypt(data string, alg aesx.AesAlg) aesx.AES[string, core.PrimitiveAES]
- func (c *Crypto) HMACFunc() func() (core.PrimitiveHMAC, error)
- func (c *Crypto) Hash(data string) string
- func (c *Crypto) HashString(data string) string
- func (c *Crypto) InitHeapDatabase() (*sql.DB, error)
- func (c *Crypto) SearchContents(ctx context.Context, table string, args func(*FindTextHeapByContentParams)) (heaps []string, err error)
- type Database
- type Entity
- type FindTextHeapByContentParams
- type FindTextHeapByHashParams
- type FindTextHeapRow
- type ILikeParams
- type Opts
- type ResultHeap
- type TextHeap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildQueryLike ¶ added in v1.3.3
func GenerateSQLConditions ¶ added in v1.3.3
func QueryContext ¶ added in v1.3.3
func StructToInterfaceScan ¶ added in v1.3.6
func StructToInterfaceScan(v interface{}) []interface{}
Types ¶
type AesKeySize ¶
type AesKeySize int
const ( Aes128KeySize AesKeySize = 16 Aes192KeySize AesKeySize = 24 Aes256KeySize AesKeySize = 32 )
type Crypto ¶
type Crypto struct { AESKey *string `env:"AES_KEY,expand" json:"aes_key"` HMACKey *string `env:"HMAC_KEY,expand" json:"hmac_key"` Host *string `env:"HEAP_DB_HOST" envDefault:"localhost" json:"db_host"` Port *string `env:"HEAP_DB_PORT" envDefault:"5432" json:"db_port"` User *string `env:"HEAP_DB_USER" envDefault:"user" json:"db_user"` Pass *string `env:"HEAP_DB_PASS" envDefault:"password" json:"db_pass"` Name *string `env:"HEAP_DB_NAME" envDefault:"dbname" json:"db_name"` // contains filtered or unexported fields }
func (*Crypto) AESWithKeyFunc ¶ added in v1.5.11
func (c *Crypto) AESWithKeyFunc(key []byte) func() (core.PrimitiveAES, error)
func (*Crypto) HashString ¶ added in v1.5.7
func (*Crypto) InitHeapDatabase ¶ added in v1.3.4
func (*Crypto) SearchContents ¶ added in v1.3.8
type FindTextHeapByContentParams ¶ added in v1.3.3
type FindTextHeapByContentParams struct {
Content string
}
type FindTextHeapByHashParams ¶ added in v1.3.3
type FindTextHeapByHashParams struct {
Hash string
}
type FindTextHeapRow ¶ added in v1.3.3
type ILikeParams ¶ added in v1.3.3
type Opts ¶ added in v1.2.3
func WithInitHeapConnection ¶ added in v1.3.9
func WithInitHeapConnection() Opts
type ResultHeap ¶ added in v1.3.4
Click to show internal directories.
Click to hide internal directories.