inputs

package
v0.1.0-alpha.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const ATTR_INPUT_TYPES = "github.com/open-component-model/ocm/cmds/ocm/common/inputs"
View Source
const KIND_INPUTTYPE = "input type"

Variables

View Source
var DefaultInputTypeScheme = NewInputTypeScheme(nil)

DefaultInputTypeScheme contains all globally known access serializer.

Functions

func FileInfo

func FileInfo(ctx clictx.Context, path string, inputFilePath string) (os.FileInfo, string, error)

func GetBaseDir

func GetBaseDir(fs vfs.FileSystem, filePath string) (string, error)

func GetPath

func GetPath(ctx clictx.Context, path string, inputFilePath string) (string, error)

func RegisterInputType

func RegisterInputType(name string, atype InputType)

func SetFor

func SetFor(ctx datacontext.Context, scheme InputTypeScheme)

func Usage

func Usage(scheme InputTypeScheme) string

Types

type Context

type Context interface {
	clictx.Context
	Printf(msg string, args ...interface{}) (int, error)
	Variables() map[string]interface{}
	Section(msg string, args ...interface{}) Context
	AddGap(gap string) Context
}

func NewContext

func NewContext(ctx clictx.Context, pr common.Printer, variables map[string]interface{}) Context

type DefaultInputType

type DefaultInputType struct {
	runtime.ObjectVersionedType
	runtime.TypedObjectDecoder
	// contains filtered or unexported fields
}

func (*DefaultInputType) ApplyConfig

func (t *DefaultInputType) ApplyConfig(opts flagsets.ConfigOptions, config flagsets.Config) error

func (*DefaultInputType) ConfigOptionTypeSetHandler

func (t *DefaultInputType) ConfigOptionTypeSetHandler() flagsets.ConfigOptionTypeSetHandler

func (*DefaultInputType) Usage

func (t *DefaultInputType) Usage() string

type GenericInputSpec

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

func ToGenericInputSpec

func ToGenericInputSpec(spec InputSpec) (*GenericInputSpec, error)

func (*GenericInputSpec) Evaluate

func (s *GenericInputSpec) Evaluate(scheme InputTypeScheme) (InputSpec, error)

func (*GenericInputSpec) GetBlob

func (s *GenericInputSpec) GetBlob(ctx Context, nv common.NameVersion, inputFilePath string) (accessio.TemporaryBlobAccess, string, error)

func (*GenericInputSpec) GetKind

func (s *GenericInputSpec) GetKind() string

func (*GenericInputSpec) GetRaw

func (s *GenericInputSpec) GetRaw() ([]byte, error)

func (*GenericInputSpec) GetType

func (s *GenericInputSpec) GetType() string

func (*GenericInputSpec) GetVersion

func (s *GenericInputSpec) GetVersion() string

func (GenericInputSpec) MarshalJSON

func (s GenericInputSpec) MarshalJSON() ([]byte, error)

func (*GenericInputSpec) UnmarshalJSON

func (s *GenericInputSpec) UnmarshalJSON(data []byte) error

func (*GenericInputSpec) Validate

func (s *GenericInputSpec) Validate(fldPath *field.Path, ctx Context, inputFilePath string) field.ErrorList

type InputSpec

type InputSpec interface {
	runtime.VersionedTypedObject
	Validate(fldPath *field.Path, ctx Context, inputFilePath string) field.ErrorList
	GetBlob(ctx Context, nv common.NameVersion, inputFilePath string) (accessio.TemporaryBlobAccess, string, error)
}

func CreateRepositorySpec

func CreateRepositorySpec(t runtime.TypedObject) (InputSpec, error)

func NewGenericInputSpec

func NewGenericInputSpec(data []byte, unmarshaler runtime.Unmarshaler) (InputSpec, error)

type InputType

type InputType interface {
	runtime.TypedObjectDecoder
	runtime.VersionedTypedObject

	ConfigOptionTypeSetHandler() flagsets.ConfigOptionTypeSetHandler

	Usage() string
}

func NewInputType

func NewInputType(name string, proto InputSpec, usage string, cfg flagsets.ConfigOptionTypeSetHandler) InputType

type InputTypeScheme

type InputTypeScheme interface {
	runtime.Scheme

	ConfigTypeSetConfigProvider() flagsets.ConfigTypeOptionSetConfigProvider
	flagsets.ConfigProvider

	GetInputType(name string) InputType
	Register(name string, atype InputType)

	DecodeInputSpec(data []byte, unmarshaler runtime.Unmarshaler) (InputSpec, error)
	CreateInputSpec(obj runtime.TypedObject) (InputSpec, error)
}

func NewInputTypeScheme

func NewInputTypeScheme(defaultRepoDecoder runtime.TypedObjectDecoder) InputTypeScheme

type UnknownInputSpec

type UnknownInputSpec struct {
	runtime.UnstructuredVersionedTypedObject `json:",inline"`
}

func (*UnknownInputSpec) GetBlob

func (r *UnknownInputSpec) GetBlob(ctx Context, nv common.NameVersion, inputFilePath string) (accessio.TemporaryBlobAccess, string, error)

func (*UnknownInputSpec) Validate

func (r *UnknownInputSpec) Validate(fldPath *field.Path, ctx Context, inputFilePath string) field.ErrorList

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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