Remove unused Name value from SupportedFormat structs
This commit is contained in:
parent
c996f3fc53
commit
d18dc9a41c
|
@ -12,7 +12,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
ReleaseVersion string = "0.70.1"
|
ReleaseVersion string = "0.70.2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -10,7 +10,6 @@ import (
|
||||||
|
|
||||||
func RegisterAudioFormats() *SupportedFormat {
|
func RegisterAudioFormats() *SupportedFormat {
|
||||||
return &SupportedFormat{
|
return &SupportedFormat{
|
||||||
Name: "audio",
|
|
||||||
Css: ``,
|
Css: ``,
|
||||||
Title: func(queryParams, fileUri, filePath, fileName, mime string) string {
|
Title: func(queryParams, fileUri, filePath, fileName, mime string) string {
|
||||||
return fmt.Sprintf(`<title>%s</title>`, fileName)
|
return fmt.Sprintf(`<title>%s</title>`, fileName)
|
||||||
|
|
|
@ -11,7 +11,6 @@ import (
|
||||||
|
|
||||||
func RegisterFlashFormats() *SupportedFormat {
|
func RegisterFlashFormats() *SupportedFormat {
|
||||||
return &SupportedFormat{
|
return &SupportedFormat{
|
||||||
Name: `flash`,
|
|
||||||
Css: ``,
|
Css: ``,
|
||||||
Title: func(queryParams, fileUri, filePath, fileName, mime string) string {
|
Title: func(queryParams, fileUri, filePath, fileName, mime string) string {
|
||||||
return fmt.Sprintf(`<title>%s</title>`, fileName)
|
return fmt.Sprintf(`<title>%s</title>`, fileName)
|
||||||
|
|
|
@ -24,7 +24,6 @@ type Dimensions struct {
|
||||||
|
|
||||||
func RegisterImageFormats() *SupportedFormat {
|
func RegisterImageFormats() *SupportedFormat {
|
||||||
return &SupportedFormat{
|
return &SupportedFormat{
|
||||||
Name: "images",
|
|
||||||
Css: ``,
|
Css: ``,
|
||||||
Title: func(queryParams, fileUri, filePath, fileName, mime string) string {
|
Title: func(queryParams, fileUri, filePath, fileName, mime string) string {
|
||||||
dimensions, err := ImageDimensions(filePath)
|
dimensions, err := ImageDimensions(filePath)
|
||||||
|
|
|
@ -13,7 +13,6 @@ import (
|
||||||
|
|
||||||
func RegisterTextFormats() *SupportedFormat {
|
func RegisterTextFormats() *SupportedFormat {
|
||||||
return &SupportedFormat{
|
return &SupportedFormat{
|
||||||
Name: "text",
|
|
||||||
Css: `pre{margin:.5rem;}`,
|
Css: `pre{margin:.5rem;}`,
|
||||||
Title: func(queryParams, fileUri, filePath, fileName, mime string) string {
|
Title: func(queryParams, fileUri, filePath, fileName, mime string) string {
|
||||||
return fmt.Sprintf(`<title>%s</title>`, fileName)
|
return fmt.Sprintf(`<title>%s</title>`, fileName)
|
||||||
|
|
|
@ -12,7 +12,6 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type SupportedFormat struct {
|
type SupportedFormat struct {
|
||||||
Name string
|
|
||||||
Css string
|
Css string
|
||||||
Title func(queryParams, fileUri, filePath, fileName, mime string) string
|
Title func(queryParams, fileUri, filePath, fileName, mime string) string
|
||||||
Body 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
|
Validate func(filePath string) bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// func (s *SupportedFormat) ListExtensions() []string
|
|
||||||
|
|
||||||
type SupportedFormats struct {
|
type SupportedFormats struct {
|
||||||
Extensions map[string]*SupportedFormat
|
Extensions map[string]*SupportedFormat
|
||||||
MimeTypes map[string]*SupportedFormat
|
MimeTypes map[string]*SupportedFormat
|
||||||
|
|
|
@ -10,7 +10,6 @@ import (
|
||||||
|
|
||||||
func RegisterVideoFormats() *SupportedFormat {
|
func RegisterVideoFormats() *SupportedFormat {
|
||||||
return &SupportedFormat{
|
return &SupportedFormat{
|
||||||
Name: "video",
|
|
||||||
Css: ``,
|
Css: ``,
|
||||||
Title: func(queryParams, fileUri, filePath, fileName, mime string) string {
|
Title: func(queryParams, fileUri, filePath, fileName, mime string) string {
|
||||||
return fmt.Sprintf(`<title>%s</title>`, fileName)
|
return fmt.Sprintf(`<title>%s</title>`, fileName)
|
||||||
|
|
Loading…
Reference in New Issue