Documentation ¶
Index ¶
- Constants
- func AnyBlank(args ...string) bool
- func Apply[T any](o *T, opts ...Option[T])
- func B64Decode(src []byte) []byte
- func Blanks(args ...string) bool
- func Bytes(data string) []byte
- func DObj[T any](source, d T) T
- func DString(source, d string) string
- func ErrorArgument(err error) error
- func ErrorArgumentf(format string, v ...any) error
- func ExternalIp() (net.IP, bool)
- func FileExists(path string) bool
- func First[S ~[]E, E any](d E, list S) E
- func IntranetIp() (net.IP, bool)
- func IsBlank(b string) bool
- func IsEmail(email string) bool
- func Language(ctx context.Context) language.Tag
- func MDExtract(ctx context.Context, key string) (string, bool)
- func Nils(objs ...any) bool
- func NonBlank(v string) bool
- func NonBlanks(args ...string) bool
- func RandomTCPListener() (net.Listener, error)
- func SQLString(s string) sql.NullString
- func SetDefaultLanguage(lang language.Tag)
- func String(data []byte) string
- type Option
- type OptionFunc
- type ResponseEntity
- type SafeRunner
Constants ¶
View Source
const TimeMillis = "15:04:05.000"
Variables ¶
This section is empty.
Functions ¶
func DObj ¶
func DObj[T any](source, d T) T
DObj returns source if not nil else return default value
func ErrorArgument ¶
func ErrorArgumentf ¶
func ExternalIp ¶
func FileExists ¶
func IntranetIp ¶
func RandomTCPListener ¶
func SetDefaultLanguage ¶
Types ¶
type OptionFunc ¶
type OptionFunc[T any] func(*T)
type ResponseEntity ¶
type ResponseEntity interface { Code() int Error() string Marshal() ([]byte, error) MarshalIdent() ([]byte, error) }
func NewErrResponse ¶
func NewErrResponse(code int, msg string) ResponseEntity
func NewResponse ¶
func NewResponse(payload any) ResponseEntity
type SafeRunner ¶
type SafeRunner struct {
// contains filtered or unexported fields
}
func NewSafeRunner ¶
func NewSafeRunner() *SafeRunner
func (*SafeRunner) Err ¶
func (r *SafeRunner) Err() error
func (*SafeRunner) Run ¶
func (r *SafeRunner) Run(fn func() error)
Click to show internal directories.
Click to hide internal directories.