flow

package
v0.0.0-...-8199c21 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NilCheck

func NilCheck[T any](t *T, constructor func() *T) *T

NilCheck returns t if it is not nil and invokes the constructor if it is.

func Tern

func Tern[T any](cond bool, a, b T) T

Tern implements ternary operator.

Types

type BitFlag

type BitFlag[T constraints.Integer] struct {
	Flag T
}

BitFlag supports bit flag operations.

func NewFlag

func NewFlag[T constraints.Integer](f T) BitFlag[T]

NewFlag creates a BitFlag

func (BitFlag[T]) Check

func (bf BitFlag[T]) Check(f T) bool

Check if bf is set on f.

func (BitFlag[T]) Clear

func (bf BitFlag[T]) Clear(f *T)

Clear the bit flag on f

func (BitFlag[T]) Set

func (bf BitFlag[T]) Set(f *T)

Set the bit flag on f

type OrBitFlag

type OrBitFlag[T constraints.Integer] []T

func NewOrFlag

func NewOrFlag[T constraints.Integer](flags ...T) OrBitFlag[T]

func (OrBitFlag[T]) Check

func (obf OrBitFlag[T]) Check(f T) bool

Jump to

Keyboard shortcuts

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