metadatautil

package
v2.11.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const ChooseAllDatabases = "All (all available databases)"

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 DatabaseChooserUIWithAll added in v2.2.0

func DatabaseChooserUIWithAll(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 JSONToYAML added in v2.5.1

func JSONToYAML(bs []byte) ([]byte, error)

func NewYamlDecoder

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

func YAMLToJSON added in v2.8.3

func YAMLToJSON(yamlbs []byte) ([]byte, error)

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
}

type YamlTagResolverError added in v2.9.0

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

func (*YamlTagResolverError) Error added in v2.9.0

func (e *YamlTagResolverError) Error() string

func (*YamlTagResolverError) Unwrap added in v2.9.0

func (e *YamlTagResolverError) Unwrap() error

Jump to

Keyboard shortcuts

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