feat(svg): added svg template delete endpoint
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user