option

package
v1.20.123 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2024 License: Zlib Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeMaxColumn = iota
	TypeFullSql
	TypeSqlColumnConvert
	TypeSubQuery
	TypeQuery
	TypeNameKey //子查询
	TypeTimeOut
	TypeAlarm
	TypeSqlDns          = 1000
	TypeSqlTls          = 1001
	TypeRedisTls        = 1002
	TypeSqlServerPubKey = 1003
)

Variables

This section is empty.

Functions

func AlarmExist added in v1.9.28

func AlarmExist(opts ...Option) bool

func Filter

func Filter(filter func(opt Option) bool, opts ...Option)

func FullSqlExist

func FullSqlExist(opts ...Option) bool

func MaxColumnExist

func MaxColumnExist(opts ...Option) int

func NameKeyExist

func NameKeyExist(opts ...Option) (string, bool)

func Select added in v1.20.112

func Select[T any](t int, defValue T, opts ...Option) (T, bool)

func SubQueryExist

func SubQueryExist(opts ...Option) (string, bool)

func TimeOutExist added in v1.9.28

func TimeOutExist(opts ...Option) (int64, bool)

Types

type ColumnConvertFunc added in v1.9.15

type ColumnConvertFunc func(col string) string

func SqlColumnConvertExist

func SqlColumnConvertExist(opts ...Option) ColumnConvertFunc

func (ColumnConvertFunc) String added in v1.9.15

func (t ColumnConvertFunc) String() string

func (ColumnConvertFunc) Type added in v1.9.15

func (t ColumnConvertFunc) Type() int

func (ColumnConvertFunc) Value added in v1.9.15

func (t ColumnConvertFunc) Value() interface{}

type Opt added in v1.9.28

type Opt[T any] struct {
	// contains filtered or unexported fields
}

func (Opt[T]) String added in v1.9.28

func (o Opt[T]) String() string

func (Opt[T]) Type added in v1.9.28

func (o Opt[T]) Type() int

func (Opt[T]) Value added in v1.9.28

func (o Opt[T]) Value() interface{}

type Option

type Option interface {
	String() string
	Type() int
	Value() interface{}
}

func Exist added in v1.8.32

func Exist(ty int, opts ...Option) (Option, bool)

func SqlColumnConvert

func SqlColumnConvert(f func(col string) string) Option

func WithAlarmKey added in v1.9.28

func WithAlarmKey() Option

func WithFullSQL

func WithFullSQL() Option

func WithMaxColumn

func WithMaxColumn(c int) Option

func WithNameKey

func WithNameKey(name string) Option

func WithOpt added in v1.9.28

func WithOpt[T any](v T, desc string, t int) Option

func WithQuery

func WithQuery() Option

func WithSubQuerySQL

func WithSubQuerySQL(as string) Option

func WithTimeOutKey added in v1.9.28

func WithTimeOutKey(timeout int64) Option

type Query

type Query struct {
	Q map[string]interface{}
}

func QueryExist

func QueryExist(opts ...Option) *Query

func (Query) String

func (t Query) String() string

func (Query) Type

func (t Query) Type() int

func (Query) Value

func (t Query) Value() interface{}

type QueryFunc

type QueryFunc func(q *Query)

func (QueryFunc) Apply

func (f QueryFunc) Apply(q *Query)

Jump to

Keyboard shortcuts

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