MCPcopy
hub / github.com/filebrowser/filebrowser / ParsePreviewSize

Function ParsePreviewSize

http/preview_enum.go:52–57  ·  view source on GitHub ↗

ParsePreviewSize attempts to convert a string to a PreviewSize

(name string)

Source from the content-addressed store, hash-verified

50
51// ParsePreviewSize attempts to convert a string to a PreviewSize
52func ParsePreviewSize(name string) (PreviewSize, error) {
53 if x, ok := _PreviewSizeValue[name]; ok {
54 return x, nil
55 }
56 return PreviewSize(0), fmt.Errorf("%s is not a valid PreviewSize, try [%s]", name, strings.Join(_PreviewSizeNames, ", "))
57}
58
59// MarshalText implements the text marshaller method
60func (x PreviewSize) MarshalText() ([]byte, error) {

Callers 4

previewHandlerFunction · 0.85
UnmarshalTextMethod · 0.85
ScanMethod · 0.85
delThumbsFunction · 0.85

Calls 1

PreviewSizeTypeAlias · 0.85

Tested by

no test coverage detected