Restructuring directory

This commit is contained in:
gmemstr 2017-07-25 07:39:49 -07:00
parent f527effcdd
commit 6ddb659974
9 changed files with 20 additions and 1 deletions

1
Makefile Normal file
View file

@ -0,0 +1 @@
Makefile

View file

@ -1,6 +1,6 @@
# whiterabbit
![gitgalaxy](https://img.shields.io/badge/website-gitgalaxy.com-blue.svg) ![shield](https://img.shields.io/badge/live-podcast.gitgalaxy.com-green.svg) ![follow](https://img.shields.io/twitter/follow/gitgalaxy.svg?style=social&label=Follow)
[![gitgalaxy](https://img.shields.io/badge/website-gitgalaxy.com-blue.svg)](https://gitgalaxy.com) [![shield](https://img.shields.io/badge/live-podcast.gitgalaxy.com-green.svg)](https://podcast.gitgalaxy.com) [![follow](https://img.shields.io/twitter/follow/gitgalaxy.svg?style=social&label=Follow)](https://twitter.com/gitgalaxy)
podcast rss generator and cms in golang

View file

@ -1,3 +1,9 @@
/* admin.go
*
* Here is where all the neccesary functions for managing episodes
* live, e.g adding removing etc.
*/
package main
import (
@ -7,6 +13,7 @@ import (
"io/ioutil"
"io"
"os"
"log"
)
func CreateEpisode(w http.ResponseWriter, r *http.Request) {
@ -42,4 +49,15 @@ func CreateEpisode(w http.ResponseWriter, r *http.Request) {
defer f.Close()
io.Copy(f, file)
}
}
func RemoveEpisode(episode string) {
// Episode should be the full MP3 filename
// Remove MP3 first
os.Remove(episode)
sn,err := strings.Replace(episode, ".mp3", "_SHOWNOTES.md", 2)
if err != nil {
log.Fatal(err)
}
os.Remove(sn)
}