util

package
v0.1.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadURL

func DownloadURL(ctx context.Context, url string) ([]byte, error)

DownloadURL downloads a file

func GetFiles

func GetFiles(paths []string, recursive bool, filter string) ([]string, error)

GetFiles _

func IsValidURL

func IsValidURL(toTest string) bool

IsValidURL tests a string to determine if it is a well-structured url or not.

func MatchFile

func MatchFile(pattern string, file string) bool

MatchFile _

func WriteMap

func WriteMap(b *bytes.Buffer, m map[string]interface{}, f Format) error

WriteMap pretty-prints the map based on the specified Format

Types

type Format

type Format string

Format _

const (
	// ORG _
	ORG Format = "org"
	// JSON _
	JSON Format = "json"
	// TOML _
	TOML Format = "toml"
	// YAML _
	YAML Format = "yaml"
	// CSV _
	CSV Format = "csv"
)

func FormatFromString

func FormatFromString(formatStr string) Format

FormatFromString returns a Format

Jump to

Keyboard shortcuts

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