utils

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Invoke0

func Invoke0(funcToBeRan func() error, opts ...InvokeOptions) error

func RandBytes

func RandBytes(length ...int) ([]byte, error)

RandBytes 根据给定的长度生成字节,长度默认为 32

func RandomHashString

func RandomHashString(length ...int) string

RandomHashString 生成随机 SHA128 字符串,最大长度为 128

func RelativePathBasedOnPwdOf

func RelativePathBasedOnPwdOf(fp string) string

func RelativePathOf

func RelativePathOf(fp string) string

RelativePathOf 获取基于调用函数的调用对象相对位置的相对路径

Types

type InvokeOptions

type InvokeOptions struct {
	// contains filtered or unexported fields
}

func WithContext

func WithContext(ctx context.Context) InvokeOptions

func (InvokeOptions) GetContext

func (o InvokeOptions) GetContext() context.Context

Jump to

Keyboard shortcuts

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