storage

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MySQLPrefix         = "mysql://"
	MongoPrefix         = "mongodb://"
	MongoSrvPrefix      = "mongodb+srv://"
	PostgresPrefix      = "postgres://"
	PostgreSQLPrefix    = "postgresql://"
	ClickhousePrefix    = "clickhouse://"
	CHHTTPPrefix        = "chhttp://"
	CHHTTPSPrefix       = "chhttps://"
	SQLitePrefix        = "sqlite://"
	RedisPrefix         = "redis://"
	RedissPrefix        = "rediss://"
	RedisClusterPrefix  = "redis+cluster://"
	RedissClusterPrefix = "rediss+cluster://"
)

Variables

This section is empty.

Functions

func AppendMySQLParams

func AppendMySQLParams(dsn string, params map[string]string) (string, error)

func AppendURLParams

func AppendURLParams(rawURL string, params []lo.Tuple2[string, string]) (string, error)

func ApplySQLPool added in v0.5.2

func ApplySQLPool(db *sql.DB, opt Options)

func NewGORMConfig

func NewGORMConfig(tablePrefix string) *gorm.Config

func ProbeMySQLIsolationVariableName

func ProbeMySQLIsolationVariableName(dsn string) (string, error)

Types

type Option

type Option func(*Options)

func WithConnMaxLifetime added in v0.5.2

func WithConnMaxLifetime(connMaxLifetime time.Duration) Option

func WithIsolationLevel

func WithIsolationLevel(isolationLevel string) Option

func WithMaxIdleConns added in v0.5.2

func WithMaxIdleConns(maxIdleConns int) Option

func WithMaxOpenConns added in v0.5.2

func WithMaxOpenConns(maxOpenConns int) Option

type Options

type Options struct {
	IsolationLevel  string
	MaxOpenConns    int
	MaxIdleConns    int
	ConnMaxLifetime time.Duration
}

func NewOptions

func NewOptions(opts ...Option) Options

type TablePrefix

type TablePrefix string

func (TablePrefix) AggregatingFeedbackTable

func (tp TablePrefix) AggregatingFeedbackTable() string

AggregatingFeedbackTable returns the aggregating feedback table.

func (TablePrefix) DocumentTable

func (tp TablePrefix) DocumentTable() string

func (TablePrefix) FeedbackTable

func (tp TablePrefix) FeedbackTable() string

func (TablePrefix) ItemFeedbackTable

func (tp TablePrefix) ItemFeedbackTable() string

ItemFeedbackTable returns the materialized view of item feedback.

func (TablePrefix) ItemsTable

func (tp TablePrefix) ItemsTable() string

func (TablePrefix) Key

func (tp TablePrefix) Key(key string) string

func (TablePrefix) LatestItemsTable

func (tp TablePrefix) LatestItemsTable() string

LatestItemsTable returns the materialized view for latest items.

func (TablePrefix) MessageTable

func (tp TablePrefix) MessageTable() string

func (TablePrefix) PointsTable

func (tp TablePrefix) PointsTable() string

func (TablePrefix) SetsTable

func (tp TablePrefix) SetsTable() string

func (TablePrefix) UserFeedbackTable

func (tp TablePrefix) UserFeedbackTable() string

UserFeedbackTable returns the materialized view of user feedback.

func (TablePrefix) UsersTable

func (tp TablePrefix) UsersTable() string

func (TablePrefix) ValuesTable

func (tp TablePrefix) ValuesTable() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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