Documentation ¶
Index ¶
- Constants
- Variables
- func FileInfo(ctx clictx.Context, path string, inputFilePath string) (os.FileInfo, string, error)
- func GetBaseDir(fs vfs.FileSystem, filePath string) (string, error)
- func GetPath(ctx clictx.Context, path string, inputFilePath string) (string, error)
- func InputFieldDoc(name string, desc string, opt flagsets.ConfigOptionType) string
- func RegisterInputType(atype InputType)
- func SetFor(ctx datacontext.Context, scheme InputTypeScheme)
- func Usage(scheme InputTypeScheme) string
- type Context
- type DefaultInputType
- type FieldSetter
- type GenericInputSpec
- func (s *GenericInputSpec) Evaluate(scheme InputTypeScheme) (InputSpec, error)
- func (s *GenericInputSpec) GetBlob(ctx Context, info InputResourceInfo) (blobaccess.BlobAccess, string, error)
- func (s *GenericInputSpec) GetInputVersion(ctx Context) string
- func (s *GenericInputSpec) GetKind() string
- func (s *GenericInputSpec) GetRaw() ([]byte, error)
- func (s *GenericInputSpec) GetType() string
- func (s *GenericInputSpec) GetVersion() string
- func (s GenericInputSpec) MarshalJSON() ([]byte, error)
- func (s *GenericInputSpec) UnmarshalJSON(data []byte) error
- func (s *GenericInputSpec) Validate(fldPath *field.Path, ctx Context, inputFilePath string) field.ErrorList
- type InputField
- type InputFieldSource
- type InputFields
- type InputResourceInfo
- type InputSpec
- type InputSpecBase
- type InputSpecDecoder
- type InputType
- type InputTypeScheme
- type UnknownInputSpec
Constants ¶
View Source
const ATTR_INPUT_TYPES = "ocm.software/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 GetBaseDir ¶
func GetBaseDir(fs vfs.FileSystem, filePath string) (string, error)
func InputFieldDoc ¶
func InputFieldDoc(name string, desc string, opt flagsets.ConfigOptionType) string
func RegisterInputType ¶
func RegisterInputType(atype InputType)
func SetFor ¶
func SetFor(ctx datacontext.Context, scheme InputTypeScheme)
func Usage ¶
func Usage(scheme InputTypeScheme) string
Types ¶
type Context ¶
type DefaultInputType ¶
type DefaultInputType struct { runtime.ObjectVersionedType runtime.TypedObjectDecoder[InputSpec] // 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 FieldSetter ¶
type FieldSetter func(opts flagsets.ConfigOptions, opt flagsets.ConfigOptionType, config flagsets.Config) error
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, info InputResourceInfo) (blobaccess.BlobAccess, string, error)
func (*GenericInputSpec) GetInputVersion ¶
func (s *GenericInputSpec) GetInputVersion(ctx Context) string
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
type InputField ¶
type InputField interface { OptionType() flagsets.ConfigOptionType Usage() string AddConfig(opts flagsets.ConfigOptions, config flagsets.Config) error }
func NewInputField ¶
func NewInputField(name, desc string, opt flagsets.ConfigOptionType, setter FieldSetter) InputField
type InputFieldSource ¶
type InputFieldSource interface {
InputFields() []InputField
}
type InputFields ¶
type InputFields []InputField
func NewInputFields ¶
func NewInputFields(fields ...InputFieldSource) InputFields
func (InputFields) AddConfig ¶
func (i InputFields) AddConfig(opts flagsets.ConfigOptions, config flagsets.Config) error
func (InputFields) InputFields ¶
func (i InputFields) InputFields() []InputField
func (InputFields) Usage ¶
func (i InputFields) Usage() string
type InputResourceInfo ¶
type InputResourceInfo struct { // ComponentVersion is the name of the component version to generate. ComponentVersion common.NameVersion // ElementName is the name of the element to create. ElementName string // The path of the file the inputs description has been taken from. InputFilePath string }
type InputSpec ¶
type InputSpec interface { runtime.VersionedTypedObject Validate(fldPath *field.Path, ctx Context, inputFilePath string) field.ErrorList GetBlob(ctx Context, info InputResourceInfo) (blobaccess.BlobAccess, string, error) GetInputVersion(ctx Context) string }
func CreateRepositorySpec ¶
func CreateRepositorySpec(t runtime.TypedObject) (InputSpec, error)
func NewGenericInputSpec ¶
func NewGenericInputSpec(data []byte, unmarshaler runtime.Unmarshaler) (InputSpec, error)
type InputSpecBase ¶
type InputSpecBase struct {
runtime.ObjectVersionedType `json:",inline"`
}
func (*InputSpecBase) GetInputVersion ¶
func (*InputSpecBase) GetInputVersion(ctx Context) string
type InputSpecDecoder ¶
type InputSpecDecoder = runtime.TypedObjectDecoder[InputSpec]
type InputType ¶
type InputType interface { runtime.VersionedTypeInfo runtime.TypedObjectDecoder[InputSpec] ConfigOptionTypeSetHandler() flagsets.ConfigOptionTypeSetHandler Usage() string }
func NewInputType ¶
type InputTypeScheme ¶
type InputTypeScheme interface { runtime.Scheme[InputSpec, InputType] ConfigTypeSetConfigProvider() flagsets.ConfigTypeOptionSetConfigProvider flagsets.ConfigProvider GetInputType(name string) InputType Register(atype InputType) GetInputSpecFor(opts flagsets.ConfigOptions) (InputSpec, error) DecodeInputSpec(data []byte, unmarshaler runtime.Unmarshaler) (InputSpec, error) CreateInputSpec(obj runtime.TypedObject) (InputSpec, error) }
func For ¶
func For(ctx datacontext.Context) InputTypeScheme
func NewInputTypeScheme ¶
func NewInputTypeScheme(defaultRepoDecoder runtime.TypedObjectDecoder[InputSpec]) InputTypeScheme
type UnknownInputSpec ¶
type UnknownInputSpec struct {
runtime.UnstructuredVersionedTypedObject `json:",inline"`
}
func (*UnknownInputSpec) GetBlob ¶
func (r *UnknownInputSpec) GetBlob(ctx Context, info InputResourceInfo) (blobaccess.BlobAccess, string, error)
func (*UnknownInputSpec) GetInputVersion ¶
func (s *UnknownInputSpec) GetInputVersion(ctx Context) string
Click to show internal directories.
Click to hide internal directories.