changed to PascalCase

This commit is contained in:
2025-08-23 19:17:20 +02:00
parent 20c9a3962f
commit 97286fb3f1
2 changed files with 15 additions and 14 deletions

14
main.go
View File

@@ -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)

View File

@@ -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{},