utils

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCurrentApDomain

func GetCurrentApDomain(username string, config MicrosoftAuthenticateConfig) string

func GetUuid

func GetUuid() string

func Throw added in v0.0.4

func Throw(exception interface{})

Throw throws out an exception, which can be caught be TryCatch or recover.

func Try added in v0.0.4

func Try(try func()) (err error)

Try implements try... logistics using internal panic...recover. It returns error if any exception occurs, or else it returns nil.

func TryCatch added in v0.0.4

func TryCatch(try func(), catch func(exception error))

TryCatch implements `try...catch..`. logistics using internal `panic...recover`. It automatically calls function `catch` if any exception occurs and passes the exception as an error. If `catch` is given nil, it ignores the panic from `try` and no panic will throw to parent goroutine.

But, note that, if function `catch` also throws panic, the current goroutine will panic.

func VerifyEmailFormat

func VerifyEmailFormat(email string) bool

Types

type MicrosoftAuthenticateConfig

type MicrosoftAuthenticateConfig struct {
	Domain map[string]string `json:"domain"`
	IsTLS  bool              `json:"is_tls"`
}

func GetMicrosoftAuthenticateConfig

func GetMicrosoftAuthenticateConfig() MicrosoftAuthenticateConfig

Jump to

Keyboard shortcuts

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