operationV2

package
v1.54.21 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OrError

func OrError(target bool, trueValue, falseValue error) error

OrError 三元运算符 → 处理错误

Types

type AttrFalseFn

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

func FalseFn

func FalseFn[T any](falseFn func() T) AttrFalseFn[T]

func (AttrFalseFn[T]) Register

func (my AttrFalseFn[T]) Register(ternary *Ternary[T])

type AttrFalseValue

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

func FalseValue

func FalseValue[T any](falseValue T) AttrFalseValue[T]

func (AttrFalseValue[T]) Register

func (my AttrFalseValue[T]) Register(ternary *Ternary[T])

type AttrTrueFn

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

func TrueFn

func TrueFn[T any](trueFn func() T) AttrTrueFn[T]

func (AttrTrueFn[T]) Register

func (my AttrTrueFn[T]) Register(ternary *Ternary[T])

type AttrTrueValue

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

func TrueValue

func TrueValue[T any](trueValue T) AttrTrueValue[T]

func (AttrTrueValue[T]) Register

func (my AttrTrueValue[T]) Register(ternary *Ternary[T])

type Ternary

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

func NewTernary

func NewTernary[T any](attrs ...TernaryAttributer[T]) Ternary[T]

func (Ternary[T]) DoByFunc

func (t Ternary[T]) DoByFunc(condition func() bool)

DoByFunc 执行回调 → 通过函数

func (Ternary[T]) DoByValue

func (t Ternary[T]) DoByValue(condition bool)

DoByValue 执行回调 → 通过值

func (Ternary[T]) GetByFunc

func (t Ternary[T]) GetByFunc(condition func() bool) T

GetByFunc 获取值 → 通过函数

func (Ternary[T]) GetByValue

func (t Ternary[T]) GetByValue(condition bool) T

GetByValue 获取值 → 通过值

func (Ternary[T]) Set

func (t Ternary[T]) Set(attrs ...TernaryAttributer[T]) Ternary[T]

type TernaryAttributer

type TernaryAttributer[T any] interface {
	Register(ternary *Ternary[T])
}

Jump to

Keyboard shortcuts

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