sets

package
v1.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Expand

func Expand(l string) []string

Expand takes a comma separated string of fmts and sets (e.g. fmt/1,@pdf,fmt/2) and expand any sets within.

func Keys

func Keys() []string

Keys returns a list of all the format sets

func Sets

func Sets(items ...string) []string

Sets takes a slice of fmts and sets (e.g. []{"fmt/1","@pdf","fmt/2"}) and expand any sets within.

Example
fmt.Printf("func %s(puid string) bool {\n  switch puid {\n  case \"%s\":\n    return true\n  }\n  return false\n}", fnName, strings.Join(Sets(tika...), "\",\""))
Output:

func IsText(puid string) bool {
  switch puid {
  case "fmt/14","fmt/15","fmt/16","fmt/17","fmt/18","fmt/19","fmt/20","fmt/37","fmt/38","fmt/39","fmt/40","fmt/95","fmt/144","fmt/145","fmt/146","fmt/147","fmt/148","fmt/157","fmt/158","fmt/276","fmt/354","fmt/412","fmt/473","fmt/476","fmt/477","fmt/478","fmt/479","fmt/480","fmt/481","fmt/488","fmt/489","fmt/490","fmt/491","fmt/492","fmt/493","fmt/523","fmt/597","fmt/599","fmt/609","fmt/754","x-fmt/45","x-fmt/111","x-fmt/273","x-fmt/274","x-fmt/275","x-fmt/276":
    return true
  }
  return false
}

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL