feat(svg): added svg template delete endpoint
build / Go-Build (push) Successful in 1m23s
build / Go-Build (pull_request) Successful in 1m23s

This commit is contained in:
2026-05-15 17:24:45 +02:00
parent 372bf4f97f
commit e39821a3e2
8 changed files with 82 additions and 4 deletions
+7
View File
@@ -15,6 +15,7 @@ import (
type SvgStorage interface {
Create(id string, svg io.Reader) (string, error)
Get(id string) (io.ReadCloser, error)
Delete(id string) error
AddFont(reader io.Reader, format string) error
GetFonts() ([]string, error)
GetFontsDir() (string, error)
@@ -68,6 +69,12 @@ func (f FileSvgStorage) Get(id string) (io.ReadCloser, error) {
return file, nil
}
func (f FileSvgStorage) Delete(id string) error {
path := filepath.Join(f.basepath, id+".svg")
defer log.Println("Deleted File: " + path)
return os.Remove(path)
}
func (f FileSvgStorage) CreatePublic(data io.Reader, filetype string) (string, error) {
path := filepath.Join(f.basepath, f.publicSubPath)
if err := os.MkdirAll(path, 0755); err != nil {