flatfile

package
v0.29.4 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiscoverOption

type DiscoverOption func(o *dOpts)

DiscoverOption configures the broadcast discovery method

func DiscoveryOptions

func DiscoveryOptions(opt map[string]string) DiscoverOption

DiscoveryOptions sets the key value pairs that make user supplied discovery options.

Supported options:

filter - GJSON Path Syntax search over YAML or JSON data
  file - set the file to read
format - override format detection: json, yaml, yml, choriarpc, results, rpc, response, text, txt

func File

func File(f string) DiscoverOption

File sets the file to read nodes from

func Filter

func Filter(f *protocol.Filter) DiscoverOption

Filter sets the filter to use for the discovery, else a blank one is used

func Format

func Format(f SourceFormat) DiscoverOption

Format specifies the file format

func Reader

func Reader(r io.Reader) DiscoverOption

Reader specifies a io.Reader as source

type FlatFile

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

func New

func New(fw inter.Framework) *FlatFile

func (*FlatFile) Discover

func (f *FlatFile) Discover(_ context.Context, opts ...DiscoverOption) (n []string, err error)

type SourceFormat

type SourceFormat int
const (

	// TextFormat reads nodes from a text file 1 node per line
	TextFormat SourceFormat

	// JSONFormat parses a JSON file expecting an array of nodes
	JSONFormat

	// YAMLFormat parses a YAML file expecting an array of nodes
	YAMLFormat

	// ChoriaResponsesFormat uses Choria responses as produced by choria req -j as source
	ChoriaResponsesFormat
)

Jump to

Keyboard shortcuts

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