15 lines
318 B
Go
Executable File
15 lines
318 B
Go
Executable File
package notes
|
|
|
|
import (
|
|
"io/ioutil"
|
|
"gitea.inhome.blapointe.com/local/notes-server/filetree"
|
|
"os"
|
|
"path"
|
|
)
|
|
|
|
func (n *Notes) Submit(urlPath, content string) error {
|
|
p := filetree.NewPathFromURL(urlPath)
|
|
os.MkdirAll(path.Dir(p.Local), os.ModePerm)
|
|
return ioutil.WriteFile(p.Local, []byte(content), os.ModePerm)
|
|
}
|