metadatautil

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoConnectedSources = errors.New("0 connected sources found on hasura")

Functions

func DatabaseChooserUI

func DatabaseChooserUI(exportMetadata func() (io.Reader, error)) (string, error)

func GetIncludeTagFiles

func GetIncludeTagFiles(node *yaml.Node, baseDirectory string) ([]string, error)

GetIncludeTagFiles files will return file paths of all child !include tag values eg: for example say the following are contents rootfile.yaml somekey: somevalue foos: !include foo.yaml

let foo.yaml contain the following contents someother: key bar: !include bar.yaml

contents of bar.yaml baz: baz

On execution of GetIncludeTagFiles(rootfile), It is expected to return rootfileparent/foo.yaml, fooparent/bar.yaml

func GetSourceKind

func GetSourceKind(exportMetadata func() (io.Reader, error), sourceName string) (*hasura.SourceKind, error)

func GetSources

func GetSources(exportMetadata func() (io.Reader, error)) ([]string, error)

func NewYamlDecoder

func NewYamlDecoder(opts YamlDecoderOpts, destination interface{}) *yamlDecoder

Types

type Source

type Source struct {
	Name string            `yaml:"name"`
	Kind hasura.SourceKind `yaml:"kind"`
}

func GetSourcesAndKind

func GetSourcesAndKind(exportMetadata func() (io.Reader, error)) ([]Source, error)

func GetSourcesAndKindStrict

func GetSourcesAndKindStrict(exportMetadata func() (io.Reader, error)) ([]Source, error)

GetSourcesAndKindStrict is like GetSourcesAndKind but will return an error when no sources are found

type YamlDecoderOpts

type YamlDecoderOpts struct {
	// directory which is to be used as the parent directory to look for filenames
	// specified in !include tag
	IncludeTagBaseDirectory string
}

Jump to

Keyboard shortcuts

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