cpi

package
v0.16.2 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const ProcessSpecUsage = `
- **<code>mediaType</code>** *string*

  This OPTIONAL property describes the media type to store with the local blob.
  The default media type is ` + mime.MIME_OCTET + ` and
  ` + mime.MIME_GZIP + ` if compression is enabled.

- **<code>compress</code>** *bool*

  This OPTIONAL property describes whether the content should be stored
  compressed or not.
`

Variables

This section is empty.

Functions

func AddMediaFileSpecConfig

func AddMediaFileSpecConfig(opts flagsets.ConfigOptions, config flagsets.Config) error

func AddPathSpecConfig

func AddPathSpecConfig(opts flagsets.ConfigOptions, config flagsets.Config) error

func AddProcessSpecConfig

func AddProcessSpecConfig(opts flagsets.ConfigOptions, config flagsets.Config) error

func AddProcessSpecOptionTypes

func AddProcessSpecOptionTypes(set flagsets.ConfigOptionTypeSetHandler)

Types

type MediaFileSpec

type MediaFileSpec struct {
	// PathSpec holds the path that points to a file to be the base for the imput
	PathSpec    `json:",inline"`
	ProcessSpec `json:",inline"`
}

func NewMediaFileSpec

func NewMediaFileSpec(typ, path, mediatype string, compress bool) MediaFileSpec

func (*MediaFileSpec) ValidateFile

func (s *MediaFileSpec) ValidateFile(fldPath *field.Path, ctx clictx.Context, inputFilePath string) (os.FileInfo, string, field.ErrorList)

type PathSpec

type PathSpec struct {
	inputs.InputSpecBase `json:",inline"`

	// Path is a file or repository path
	Path string `json:"path"`
}

func NewPathSpec

func NewPathSpec(typ, path string) PathSpec

func (*PathSpec) Validate

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

type ProcessSpec

type ProcessSpec struct {
	MediaType        string `json:"mediaType,omitempty"`
	CompressWithGzip *bool  `json:"compress,omitempty"`
}

func NewProcessSpec

func NewProcessSpec(mediatype string, compress bool) ProcessSpec

func (*ProcessSpec) Compress

func (s *ProcessSpec) Compress() bool

Compress returns if the blob should be compressed using gzip.

func (*ProcessSpec) ProcessBlob

func (*ProcessSpec) SetMediaTypeIfNotDefined

func (s *ProcessSpec) SetMediaTypeIfNotDefined(mediaType string)

SetMediaTypeIfNotDefined sets the media type of the input blob if its not defined.

Jump to

Keyboard shortcuts

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