Move to Traefik

This commit is contained in:
Tom Wiesing 2022-10-07 19:46:14 +02:00
parent bf57c0d5a6
commit 471ccbadc5
No known key found for this signature in database
36 changed files with 200 additions and 190 deletions

View file

@ -1,6 +1,7 @@
package fsx
import (
"io/fs"
"time"
"github.com/FAU-CDI/wisski-distillery/pkg/environment"
@ -11,11 +12,14 @@ import (
//
// If the file does not exist exists, it is created using [env.Create].
// If the file does exist, it's access and modification times are updated to the current time.
func Touch(env environment.Environment, path string) error {
func Touch(env environment.Environment, path string, perm fs.FileMode) error {
if perm == 0 {
perm = environment.DefaultFilePerm
}
_, err := env.Stat(path)
switch {
case environment.IsNotExist(err):
f, err := env.Create(path, environment.DefaultFilePerm)
f, err := env.Create(path, perm)
if err != nil {
return err
}

View file

@ -177,7 +177,7 @@ parseloop:
// Check if there were missing template keys.
// If so, we sort them and return an appropriate error.
if len(missingKeys) != 0 {
keys := maps.Keys(unusedKeys)
keys := maps.Keys(missingKeys)
slices.Sort(keys)
return MissingTemplateKeyError{
Keys: keys,