changed to PascalCase
This commit is contained in:
14
main.go
14
main.go
@@ -1,22 +1,12 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"Advertisement_Panel/src"
|
||||
"fmt"
|
||||
"html/template"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type FileData struct {
|
||||
ImageNames []string
|
||||
SpicyImageNames []string
|
||||
AsciiFiles []AsciiEntry
|
||||
}
|
||||
|
||||
type AsciiEntry struct {
|
||||
Name string
|
||||
FontSize int
|
||||
}
|
||||
|
||||
var templ *template.Template
|
||||
|
||||
func main() {
|
||||
@@ -27,7 +17,7 @@ func main() {
|
||||
http.HandleFunc("/", index_handler)
|
||||
|
||||
// Serves json for html to find file names
|
||||
http.HandleFunc("/files", file_handler)
|
||||
http.HandleFunc("/files", src.FileHandler)
|
||||
|
||||
// Serves ascii page
|
||||
http.HandleFunc("/ascii", ascii_handler)
|
||||
|
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package src
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
@@ -10,8 +10,19 @@ import (
|
||||
|
||||
const staticDir = "static"
|
||||
|
||||
type FileData struct {
|
||||
ImageNames []string
|
||||
SpicyImageNames []string
|
||||
AsciiFiles []AsciiEntry
|
||||
}
|
||||
|
||||
type AsciiEntry struct {
|
||||
Name string
|
||||
FontSize int
|
||||
}
|
||||
|
||||
// move FileData and AsciiEntry here if you want, or leave in main.go
|
||||
func file_handler(w http.ResponseWriter, r *http.Request) {
|
||||
func FileHandler(w http.ResponseWriter, r *http.Request) {
|
||||
data := FileData{
|
||||
ImageNames: []string{},
|
||||
SpicyImageNames: []string{},
|
Reference in New Issue
Block a user