Remove unused Name value from SupportedFormat structs

This commit is contained in:
Seednode 2023-09-12 13:19:24 -05:00
parent c996f3fc53
commit d18dc9a41c
7 changed files with 3 additions and 11 deletions

View File

@ -12,7 +12,7 @@ import (
)
const (
ReleaseVersion string = "0.70.1"
ReleaseVersion string = "0.70.2"
)
var (

View File

@ -10,7 +10,6 @@ import (
func RegisterAudioFormats() *SupportedFormat {
return &SupportedFormat{
Name: "audio",
Css: ``,
Title: func(queryParams, fileUri, filePath, fileName, mime string) string {
return fmt.Sprintf(`<title>%s</title>`, fileName)

View File

@ -11,7 +11,6 @@ import (
func RegisterFlashFormats() *SupportedFormat {
return &SupportedFormat{
Name: `flash`,
Css: ``,
Title: func(queryParams, fileUri, filePath, fileName, mime string) string {
return fmt.Sprintf(`<title>%s</title>`, fileName)

View File

@ -24,7 +24,6 @@ type Dimensions struct {
func RegisterImageFormats() *SupportedFormat {
return &SupportedFormat{
Name: "images",
Css: ``,
Title: func(queryParams, fileUri, filePath, fileName, mime string) string {
dimensions, err := ImageDimensions(filePath)

View File

@ -13,8 +13,7 @@ import (
func RegisterTextFormats() *SupportedFormat {
return &SupportedFormat{
Name: "text",
Css: `pre{margin:.5rem;}`,
Css: `pre{margin:.5rem;}`,
Title: func(queryParams, fileUri, filePath, fileName, mime string) string {
return fmt.Sprintf(`<title>%s</title>`, fileName)
},

View File

@ -12,7 +12,6 @@ import (
)
type SupportedFormat struct {
Name string
Css string
Title func(queryParams, fileUri, filePath, fileName, mime string) string
Body func(queryParams, fileUri, filePath, fileName, mime string) string
@ -21,8 +20,6 @@ type SupportedFormat struct {
Validate func(filePath string) bool
}
// func (s *SupportedFormat) ListExtensions() []string
type SupportedFormats struct {
Extensions map[string]*SupportedFormat
MimeTypes map[string]*SupportedFormat

View File

@ -10,8 +10,7 @@ import (
func RegisterVideoFormats() *SupportedFormat {
return &SupportedFormat{
Name: "video",
Css: ``,
Css: ``,
Title: func(queryParams, fileUri, filePath, fileName, mime string) string {
return fmt.Sprintf(`<title>%s</title>`, fileName)
},