Documentation
¶
Index ¶
- Constants
- Variables
- func AnalyzeCode(tr *taskrunner.TaskRunner, 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 GetTimeInSevenDays() 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 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 StructuredLogger
Constants ¶
View Source
const ( DirectoryField = "directory" SizeInBytesField = "size_in_bytes" FolderToFindField = "folder_to_find" InitialDirField = "initial_directory" HostField = "host" CurrentAttemptField = "current_attempt" MaximumAttemptsFields = "maximum_attempts" )
View Source
const (
ErrorField = "error"
)
Variables ¶
View Source
var Logger = ProvideLogger(os.Getenv("LOG_LEVEL"), true)
Functions ¶
func AnalyzeCode ¶ added in v0.0.56
func AnalyzeCode(tr *taskrunner.TaskRunner, 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 GetTimeInSevenDays ¶ added in v0.0.93
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 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 {
Cookie *http.Cookie
SetCookieHeader bool
RootUrl string
Origin string
VerifyCertificate bool
}
func (*ComponentClient) DoRequest ¶
func (c *ComponentClient) DoRequest(path string, payload interface{}) ([]byte, error)
func (*ComponentClient) DoRequestWithFullResponse ¶
func (c *ComponentClient) DoRequestWithFullResponse(path string, payload interface{}) (*http.Response, error)
type StructuredLogger ¶ added in v0.0.109
type StructuredLogger interface {
Debug(msg string, kv ...any)
Info(msg string, kv ...any)
Warn(msg string, kv ...any)
Error(msg string, kv ...any)
}
func ProvideLogger ¶ added in v0.0.68
func ProvideLogger(logLevel string, showCaller bool) StructuredLogger
idea for later: add the software version to the log so that "source" attribute deterministally references its origin
Click to show internal directories.
Click to hide internal directories.