file

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2015 License: MIT Imports: 10 Imported by: 0

README

File source

Currently supports YAML files only. More example files.

Example URLs

--source=file:///absolute/path/to/file.yml
--source=file://relative/path/to/file.yml
--source=file://../relative/path/to/file.yml
--source=file://file.yml

Default label

  • If you don't ask for a specific label, it will

    • return label default if found
    • or return first found label
  • If you ask for a specific label, it will

    • return this specific label if found
    • and just don't return anything else if not found

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyPath   = errors.New("source: file: no path given")
	ErrYamlParsing = errors.New("source: file: yaml parsing failed")
	ErrYamlLevels  = errors.New("source: file: only 2 levels of indentation allowed")
)

Functions

This section is empty.

Types

type File

type File struct {
	// contains filtered or unexported fields
}

File implements Source interface

func (*File) ExampleUrl

func (s *File) ExampleUrl() string

func (*File) Labels

func (s *File) Labels() []string

func (*File) Load

func (s *File) Load(label string, u *url.URL) (*data.Data, error)

func (*File) Scheme

func (s *File) Scheme() string

Jump to

Keyboard shortcuts

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