config

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GeneralConfig

type GeneralConfig struct {
	Database      string `json:"database"`
	Table         string `json:"table"`
	PrimaryKey    string `json:"primary_key"`
	SoftDeletable bool   `json:"soft_deletable"`
	StatusName    string `json:"status_name"`
	StatusType    string `json:"status_type"`
}

type IBaseRepo added in v0.1.2

type IBaseRepo[C, U, G any] interface {
	Create(C, func(id int64), func(record int64))
	Update(int64, U, func(), func(int64))
	GetOne(int64, func(G), func(int64), ...SubQuery)
	DeleteOne(int64, func(), func(int64))
	ChangeStatus(int64, int64, func(), func(int64))
}

type PGXBaseRepoConfig added in v0.1.1

type PGXBaseRepoConfig struct {
	Ctx context.Context `json:"ctx"`
	Db  ports.IBaseDb   `json:"db"`
	GeneralConfig
}

func (PGXBaseRepoConfig) ToPostgresConfig added in v0.1.2

func (c PGXBaseRepoConfig) ToPostgresConfig() PostgresConfig

type PGXDbConfig added in v0.1.2

type PGXDbConfig struct {
	Host      string `json:"host"`
	Port      int    `json:"port"`
	User      string `json:"user"`
	Pass      string `json:"pass"`
	DefaultDb string `json:"default_db"`
	MaxConn   int    `json:"max_conn"`
}

type PQBaseRepoConfig added in v0.1.1

type PQBaseRepoConfig struct {
	Db ports.IBaseDb `json:"db"`
	GeneralConfig
}

func (PQBaseRepoConfig) ToPostgresConfig added in v0.1.2

func (c PQBaseRepoConfig) ToPostgresConfig() PostgresConfig

type PQDbConfig added in v0.1.2

type PQDbConfig struct {
	Host      string `json:"host"`
	Port      int    `json:"port"`
	User      string `json:"user"`
	Pass      string `json:"pass"`
	DefaultDb string `json:"default_db"`
}

type PostgresConfig added in v0.1.2

type PostgresConfig struct {
	Ctx context.Context `json:"ctx"`
	Db  ports.IBaseDb   `json:"db"`
	GeneralConfig
}

type SQLXBaseRepoConfig added in v0.1.1

type SQLXBaseRepoConfig struct {
	Db ports.IBaseDb `json:"db"`
	GeneralConfig
}

func (SQLXBaseRepoConfig) ToPostgresConfig added in v0.1.2

func (c SQLXBaseRepoConfig) ToPostgresConfig() PostgresConfig

type SQLXDbConfig added in v0.1.2

type SQLXDbConfig struct {
	Host      string `json:"host"`
	Port      int    `json:"port"`
	User      string `json:"user"`
	Pass      string `json:"pass"`
	DefaultDb string `json:"default_db"`
}

type SubQuery added in v0.1.2

type SubQuery struct {
	IsSingle bool   `json:"is_one"`
	Alias    string `json:"alias"`
	Query    string `json:"query"`
}

Jump to

Keyboard shortcuts

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