content

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: MIT Imports: 5 Imported by: 4

Documentation

Index

Constants

View Source
const (
	FileTypeYAML    = "yaml"
	FileTypeJSON    = "json"
	FileTypeCSV     = "csv"
	FileTypeString  = "string"
	FileTypeUnknown = "unknown"
)

Variables

This section is empty.

Functions

func IsCSV

func IsCSV(content string) bool

IsCSV checks if the passed content of CSV.

func IsJSON

func IsJSON(content string) bool

IsJSON checks if the passed content of JSON.

func IsJSONString added in v0.0.5

func IsJSONString(content string) bool

IsJSONString checks if the passed content of JSON string.

func IsYAML

func IsYAML(log *logrus.Logger, content string) bool

IsYAML checks if the passed content of YAML.

func IsYAMLString added in v0.0.5

func IsYAMLString(log *logrus.Logger, content string) bool

IsYAMLString checks if the passed content of YAML string.

Types

type Object

type Object string

Object implements method that check for file content type.

func Marshal added in v0.0.4

func Marshal(data interface{}) (Object, error)

func (Object) CheckFileType

func (obj Object) CheckFileType(log *logrus.Logger) string

CheckFileType checks the file type of the content passed, it validates for YAML/JSON.

func (Object) String

func (obj Object) String() string

String should return the string equivalent of Object.

Jump to

Keyboard shortcuts

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