scriptoption

package
v2.0.0-...-98cc131 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigType   = "scripts.ocm" + cfgcpi.OCM_CONFIG_TYPE_SUFFIX
	ConfigTypeV1 = ConfigType + runtime.VersionSeparator + "v1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	runtime.ObjectVersionedType `json:",inline"`
	Scripts                     map[string]ScriptSpec `json:"scripts"`
}

Config describes a memory based repository interface.

func NewConfig

func NewConfig() *Config

NewConfig creates a new memory ConfigSpec.

func (*Config) AddScript

func (a *Config) AddScript(name string, data []byte)

func (*Config) AddScriptFile

func (a *Config) AddScriptFile(name, path string, fss ...vfs.FileSystem)

func (*Config) ApplyTo

func (a *Config) ApplyTo(ctx cfgcpi.Context, target interface{}) error

func (*Config) GetType

func (a *Config) GetType() string

type Option

type Option struct {
	ScriptFile string
	Script     string
	ScriptData []byte
	FileSystem vfs.FileSystem
}

func From

func New

func New() *Option

func (*Option) AddFlags

func (o *Option) AddFlags(fs *pflag.FlagSet)

func (*Option) Configure

func (o *Option) Configure(ctx clictx.Context) error

func (*Option) Usage

func (o *Option) Usage() string

type ScriptSpec

type ScriptSpec struct {
	Path       string          `json:"path,omitempty"`
	Script     json.RawMessage `json:"script,omitempty"`
	FileSystem vfs.FileSystem  `json:"-"`
}

Jump to

Keyboard shortcuts

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