datasource

package
v0.0.0-...-8693642 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

The datasource package is responsible for the specification and identification of datasources.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInUse      = errInUse()
	ErrInvalidExt = errInvalidExt()
	ErrNotExist   = errNotExist()
)

Functions

func Add

func Add(spec specification, overwriteExisting bool) error

Add stores the given specification in the filesystem.

func Find

func Find(alias string) (found bool, path string, err error)

Find identifies a file described by the specification with the given alias.

Types

type FilenameSpec

type FilenameSpec struct {
	Filename        string
	NameIsSubstring bool
}

FilenameSpec identifies a file based on its name.

type Specification

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

Specification represents a datasource specification.

func (Specification) Alias

func (cfg Specification) Alias() string

Alias returns the value of alias.

func (Specification) FileType

func (cfg Specification) FileType() string

FileType returns the value of fileType.

func (Specification) FilenameSpecs

func (cfg Specification) FilenameSpecs() []FilenameSpec

FilenameSpecs returns the value of filenameSpecs.

func (Specification) IncludeProgramDirectory

func (cfg Specification) IncludeProgramDirectory() bool

IncludeProgramDirectory returns the value of includeProgramDirectory.

func (Specification) Paths

func (cfg Specification) Paths() []string

Paths returns the value of paths.

func (Specification) RequireAllValueSpecs

func (cfg Specification) RequireAllValueSpecs() bool

RequireAllValueSpecs returns the value of requireAllValueSpecs.

func (*Specification) SetAlias

func (cfg *Specification) SetAlias(a string)

SetAlias assigns the value of alias.

func (*Specification) SetFileType

func (cfg *Specification) SetFileType(t string)

SetFileType assigns the value of fileType.

func (*Specification) SetFilenameSpecs

func (cfg *Specification) SetFilenameSpecs(f []FilenameSpec)

SetFilenameSpecs assigns the value of filenameSpecs.

func (*Specification) SetIncludeProgramDirectory

func (cfg *Specification) SetIncludeProgramDirectory(include bool)

SetIncludeProgramDirectory assigns the value of includeProgramDirectory.

func (*Specification) SetPaths

func (cfg *Specification) SetPaths(p []string)

SetPaths assigns the value of paths.

func (*Specification) SetRequireAllValueSpecs

func (cfg *Specification) SetRequireAllValueSpecs(b bool)

SetRequireAllValueSpecs assigns the value of requireAllValueSpecs.

func (*Specification) SetValueSpecs

func (cfg *Specification) SetValueSpecs(v []ValueSpec)

SetValueSpecs assigns the value of valueSpecs.

func (Specification) ValueSpecs

func (cfg Specification) ValueSpecs() []ValueSpec

ValueSpecs returns the value of valueSpecs.

type ValueSpec

type ValueSpec struct {
	Value       string // The full or partial value expected to be found.
	IsSubstring bool   // Indicates that the value is partial.
	InRow       int    // The 1-based row the value should be in.
	InColumn    int    // The 1-based column the value should be in.
	AnyPage     bool   // Indicates that the value may be on any page within the file.
	Page        int    // The 1-based page the value should be within.
}

ValueSpec specifies a value and location within a datasource.

A ValueSpec can be considered qualifying or disqualifying. If a ValueSpec is disqualifying, it is ignored.

See the qualifies method for more information on disqualifying attributes.

Jump to

Keyboard shortcuts

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