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