formats

package
v3.8.1 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: MPL-2.0 Imports: 1 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsEnvFile

func IsEnvFile(path string) bool

IsEnvFile returns true if a given file path corresponds to a .env file

func IsIniFile

func IsIniFile(path string) bool

IsIniFile returns true if a given file path corresponds to a INI file

func IsJSONFile

func IsJSONFile(path string) bool

IsJSONFile returns true if a given file path corresponds to a JSON file

func IsYAMLFile

func IsYAMLFile(path string) bool

IsYAMLFile returns true if a given file path corresponds to a YAML file

Types

type Format

type Format int

Format is an enum type

const (
	Binary Format = iota
	Dotenv
	Ini
	Json
	Yaml
)

func FormatForPath

func FormatForPath(path string) Format

FormatForPath returns the correct format given the path to a file

func FormatForPathOrString

func FormatForPathOrString(path, format string) Format

FormatForPathOrString returns the correct format-specific implementation of the Store interface given the formatString if specified, or the path to a file. This is to support the cli, where both are provided.

func FormatFromString

func FormatFromString(formatString string) Format

FormatFromString returns a Format from a string. This is used for converting string cli options.

Jump to

Keyboard shortcuts

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