asset

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: Apache-2.0 Imports: 8 Imported by: 15

Documentation

Overview

Copyright Contributors to the Open Cluster Management project

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ScenarioReader

type ScenarioReader interface {
	//Retrieve an asset from the data source
	Asset(templatePath string) ([]byte, error)
	//List all available assets in the data source
	AssetNames(excluded []string) ([]string, error)
	ExtractAssets(prefix, dir string, excluded []string) error
	ToJSON(b []byte) ([]byte, error)
}

type ScenarioResourcesReader

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

func NewScenarioResourcesReader

func NewScenarioResourcesReader(files *embed.FS) *ScenarioResourcesReader

func (*ScenarioResourcesReader) Asset

func (r *ScenarioResourcesReader) Asset(name string) ([]byte, error)

func (*ScenarioResourcesReader) AssetNames

func (r *ScenarioResourcesReader) AssetNames(excluded []string) ([]string, error)

func (*ScenarioResourcesReader) ExtractAssets

func (r *ScenarioResourcesReader) ExtractAssets(prefix, dir string, excluded []string) error

func (*ScenarioResourcesReader) ToJSON

func (r *ScenarioResourcesReader) ToJSON(b []byte) ([]byte, error)

type YamlFileReader

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

YamlFileReader defines a reader for yaml files

func NewDirectoriesReader

func NewDirectoriesReader(
	header string,
	paths []string,
) *YamlFileReader

NewDirectoriesReader constructs a new YamlFileReader

func (*YamlFileReader) Asset

func (r *YamlFileReader) Asset(
	name string,
) ([]byte, error)

Asset returns an asset

func (*YamlFileReader) AssetNames

func (r *YamlFileReader) AssetNames(excluded []string) ([]string, error)

AssetNames returns the name of all assets

func (*YamlFileReader) ExtractAssets

func (r *YamlFileReader) ExtractAssets(prefix, dir string, excluded []string) error

func (*YamlFileReader) ToJSON

func (*YamlFileReader) ToJSON(
	b []byte,
) ([]byte, error)

ToJSON converts to JSON

Jump to

Keyboard shortcuts

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