Documentation
¶
Index ¶
- Constants
- Variables
- func AnalyzeCode(dir string)
- func Close(r Closable)
- func CollectBuildTags(dir string) ([]string, error)
- func DoesMatchSaltedHash(clearText, saltedHash string) bool
- func Execute(commandStr string)
- func ExecuteShellCommand(shellCommand string) error
- func FindDir(dirName string) string
- func GenerateCookie() (*http.Cookie, error)
- func GetCorsDisablingHandler(next http.Handler) http.Handler
- func GetErrMsg(actualStatusCode int, respBodyMsg string) string
- func GetLogLevel() string
- func GetTimeIn30Days() time.Time
- func Hash(clearText string) (string, error)
- func RemoveDir(path string)
- func RunMigrations(migrationsDir, host, port string)
- func SaltAndHash(clearText string) (string, error)
- func SendJsonResponse(w http.ResponseWriter, data interface{})
- func SetCookieHeaders(req *http.Request, c *ComponentClient)
- func SetHideCallerInLogs(hide bool)
- func UnpackResponse[T any](object interface{}) (*T, error)
- func UnzipToTempDir(zipBytes []byte) (string, error)
- func WaitForPostgresDb(host, port string) (*sql.DB, error)
- func ZipDirectoryToBytes(dirPath string) ([]byte, error)
- type Closable
- type ComponentClient
- type LoggerType
Constants ¶
View Source
const ( TRACE logLevelValue = iota DEBUG INFO WARN ERROR )
Variables ¶
View Source
var (
DataDir = "data"
)
View Source
var Logger = ProvideLogger(os.Getenv("LOG_LEVEL"))
Functions ¶
func AnalyzeCode ¶ added in v0.0.56
func AnalyzeCode(dir string)
func CollectBuildTags ¶ added in v0.0.68
func DoesMatchSaltedHash ¶ added in v0.0.45
func ExecuteShellCommand ¶ added in v0.0.45
func GenerateCookie ¶ added in v0.0.22
func GetCorsDisablingHandler ¶ added in v0.0.21
GetCorsDisablingHandler This is necessary to allow cross-origin requests.
func GetLogLevel ¶ added in v0.0.68
func GetLogLevel() string
func GetTimeIn30Days ¶ added in v0.0.22
func RunMigrations ¶ added in v0.0.50
func RunMigrations(migrationsDir, host, port string)
func SaltAndHash ¶ added in v0.0.23
func SendJsonResponse ¶
func SendJsonResponse(w http.ResponseWriter, data interface{})
func SetCookieHeaders ¶ added in v0.0.35
func SetCookieHeaders(req *http.Request, c *ComponentClient)
func SetHideCallerInLogs ¶ added in v0.0.68
func SetHideCallerInLogs(hide bool)
func UnpackResponse ¶ added in v0.0.32
func UnzipToTempDir ¶ added in v0.0.42
UnzipToTempDir unzips the given zip bytes to a temporary directory and returns the path to the directory.
func WaitForPostgresDb ¶ added in v0.0.51
func ZipDirectoryToBytes ¶ added in v0.0.30
Types ¶
type ComponentClient ¶
type ComponentClient struct {
User string
Password string
NewPassword string
Cookie *http.Cookie
SetCookieHeader bool
RootUrl string
Origin string
VerifyCertificate bool
}
func (*ComponentClient) DoRequest ¶
func (c *ComponentClient) DoRequest(path string, payload interface{}, expectedMessage string) ([]byte, error)
func (*ComponentClient) DoRequestWithFullResponse ¶
type LoggerType ¶ added in v0.0.68
type LoggerType interface {
Trace(message string, v ...any)
Debug(message string, v ...any)
Info(message string, v ...any)
Warn(message string, v ...any)
Error(message string, v ...any)
Fatal(message string, v ...any)
}
func ProvideLogger ¶ added in v0.0.68
func ProvideLogger(logLevel string) LoggerType
Click to show internal directories.
Click to hide internal directories.