Documentation
¶
Index ¶
- Variables
- func Abs[T Numeric](x T) T
- func AllNamedEnums[T IEnum](min T, max T) []T
- func ExecAllDeathHooks()
- func FillEnum[T IEnum](sp *[]T, min T, max T)
- func Fly(fnc func())
- func FuncName(act any) string
- func GetFreePort() (int, error)
- func IsDeathing() bool
- func JsonStreamZeroCopy(fp string) (iter.Seq2[json.RawMessage, error], error)
- func MarshalJSON(val any) ([]byte, error)
- func MarshalJSONString(val any) (string, error)
- func Must[T any](val T, err error) T
- func MustJsonMarshalIndent(v any) []byte
- func MustJsonMarshalIndentString(v any) string
- func MustJsonMarshalString(v any) string
- func MustMarshalJSON(v any) []byte
- func OnDeath(fn func(wg *sync.WaitGroup))
- func Peek[T IJsonValue](mapv map[string]any, keys ...string) (T, bool)
- func RandAsciiBytes(length int) []byte
- func RandBytes(pool []byte, length int) []byte
- func RandLowerAsciiBytes(length int) []byte
- func ReadDirStream(dir string) (iter.Seq2[os.FileInfo, error], error)
- func ReadStack(skip int, size int) string
- func UnmarshalJSON(bytes []byte, dest any) error
- func UnmarshalJSONString(txt string, dest any) error
- func WalkStream(root string, opts *WalkOptions) (iter.Seq2[*FileInfoWithDir, error], error)
- type FileInfoWithDir
- type IEnum
- type IJsonValue
- type ITaskItem
- type IntType
- type Numeric
- type Set
- type SingedInt
- type TaskFuncType
- type TaskPool
- type TaskPoolOptions
- type UnsignedInt
- type WalkOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTaskPoolQueueFull = errors.New("rrscpkgs.taskpool: queue full") ErrTaskPoolClosed = errors.New("rrscpkgs.taskpool: closed") )
View Source
var ( DEATH_SIGNALS = []os.Signal{ syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP, } )
View Source
var (
ErrJsonStreamBadElement = errors.New("json stream: bad element, required '{'")
)
Functions ¶
func AllNamedEnums ¶
func AllNamedEnums[T IEnum](min T, max T) []T
func ExecAllDeathHooks ¶
func ExecAllDeathHooks()
func GetFreePort ¶
func IsDeathing ¶
func IsDeathing() bool
func JsonStreamZeroCopy ¶
func MarshalJSON ¶
func MarshalJSONString ¶
func MustJsonMarshalIndent ¶
func MustJsonMarshalString ¶
func MustMarshalJSON ¶
func RandAsciiBytes ¶
func RandLowerAsciiBytes ¶
func UnmarshalJSON ¶
func UnmarshalJSONString ¶
func WalkStream ¶
func WalkStream(root string, opts *WalkOptions) (iter.Seq2[*FileInfoWithDir, error], error)
Types ¶
type FileInfoWithDir ¶
func (*FileInfoWithDir) Fullpath ¶
func (fi *FileInfoWithDir) Fullpath() string
func (*FileInfoWithDir) String ¶
func (fi *FileInfoWithDir) String() string
type IntType ¶
type IntType interface {
SingedInt | UnsignedInt
}
type Numeric ¶
type Numeric interface {
constraints.Signed | constraints.Float
}
type Set ¶
type Set[T comparable] map[T]struct{}
type TaskFuncType ¶
func (TaskFuncType) Exec ¶
func (t TaskFuncType) Exec(ctx context.Context)
type TaskPool ¶
type TaskPool struct {
// contains filtered or unexported fields
}
func NewTaskPool ¶
func NewTaskPool(opts *TaskPoolOptions) *TaskPool
type TaskPoolOptions ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.