pkgio

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 31 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IgnoreFileMatch = []string{".ignore"}
View Source
var JSONMatch = []string{"*.json"}
View Source
var MarkdownMatch = []string{"*.md"}
View Source
var MatchAll = []string{"*"}
View Source
var ReadmeFileMatch = []string{"README.md"}
View Source
var YAMLMatch = []string{"*.yaml", "*.yml"}

Functions

func SplitDocuments added in v0.0.3

func SplitDocuments(s string) ([]string, error)

splitDocuments returns a slice of all documents contained in a YAML string. Multiple documents can be divided by the YAML document separator (---). It allows for white space and comments to be after the separator on the same line, but will return an error if anything else is on the line.

Types

type ByteReader added in v0.0.3

type ByteReader struct {
	Reader io.Reader

	// allows the consumer to specify its own data store
	DataStore store.Storer[[]byte]

	// Path of the file the user is reading
	Path string
}

func (*ByteReader) Read added in v0.0.3

func (r *ByteReader) Read(ctx context.Context) (store.Storer[[]byte], error)

type ByteWriter added in v0.0.3

type ByteWriter struct {
	Type OutputSink
	// Could be a file or directory
	Path string
}

func (*ByteWriter) Write added in v0.0.3

func (r *ByteWriter) Write(ctx context.Context, datastore store.Storer[[]byte]) error

type DirReader added in v0.0.3

type DirReader struct {
	Path           string // dir
	Fsys           fsys.FS
	MatchFilesGlob MatchFilesGlob
	IgnoreRules    *ignore.Rules
	SkipDir        bool
	Checksum       bool
}

func (*DirReader) Read added in v0.0.3

func (r *DirReader) Read(ctx context.Context) (store.Storer[[]byte], error)

type FileReader added in v0.0.3

type FileReader struct {
	FileName string
	Fsys     fsys.FS
	Checksum bool
}

func (*FileReader) Read added in v0.0.3

func (r *FileReader) Read(ctx context.Context) (store.Storer[[]byte], error)

type GitReader added in v0.0.3

type GitReader struct {
	// URL of the Git Repository
	URL string
	// Secret with crendentials to access the repo
	Secret string
	// Deployment determines if this is a catalog repo or not
	Deployment bool
	// Directory used in the git repository as an offset
	Directory string
	// PackageID identifies target, repo, realm, package, workspace and revision (if assigned)
	PkgID *pkgid.PackageID
	// PkgPath identifies the localation of the package in the local filesystem
	PkgPath string
	// allows the consumer to specify its own data store
	DataStore store.Storer[[]byte]
}

func (*GitReader) Read added in v0.0.3

func (r *GitReader) Read(ctx context.Context) (store.Storer[[]byte], error)

type GitWriter added in v0.0.3

type GitWriter struct {
	// URL of the Git Repository
	URL string
	// Secret with crendentials to access the repo
	Secret string
	// Deployment determines if this is a catalog repo or not
	Deployment bool
	// Directory used in the git repository as an offset
	Directory string
	// PackageID identifies target, repo, realm, package, workspace and revision (if assigned)
	PkgID *pkgid.PackageID
	// PkgPath identifies the localation of the package in the local filesystem
	PkgPath string
}

func (*GitWriter) Write added in v0.0.3

func (r *GitWriter) Write(ctx context.Context, datastore store.Storer[[]byte]) error

type InventoryReader added in v0.0.3

type InventoryReader struct {
}

func (*InventoryReader) Read added in v0.0.3

type KformDirReader added in v0.0.3

type KformDirReader struct {
	Path  string
	Input bool
}

func (*KformDirReader) Read added in v0.0.3

type KformFileReader added in v0.0.3

type KformFileReader struct {
	Path  string
	Input bool
}

func (*KformFileReader) Read added in v0.0.3

type KformMemReader added in v0.0.3

type KformMemReader struct {
	Resources map[string]string
	Data      store.Storer[[]byte]
	Input     bool
}

func (*KformMemReader) Read added in v0.0.3

type KformStreamReader added in v0.0.3

type KformStreamReader struct {
	Reader io.Reader
	Input  bool
}

func (*KformStreamReader) Read added in v0.0.3

type KformWriter added in v0.0.3

type KformWriter struct {
	//Writer io.Writer
	Type OutputSink
	// Could be a file or directory
	Path string
}

func (*KformWriter) Write added in v0.0.3

func (r *KformWriter) Write(ctx context.Context, datastore store.Storer[data.BlockData]) error

type MatchFilesGlob added in v0.0.3

type MatchFilesGlob []string

type OutputSink added in v0.0.3

type OutputSink int64
const (
	OutputSink_None OutputSink = iota
	OutputSink_File
	OutputSink_FileRetain
	OutputSink_Dir
	OutputSink_StdOut
	OutputSink_Memory
)

type Process

type Process[T1 any] interface {
	Process(context.Context, store.Storer[T1]) (store.Storer[T1], error)
}

type Reader

type Reader[T1 any] interface {
	Read(context.Context) (store.Storer[T1], error)
}

type Writer

type Writer[T1 any] interface {
	Write(context.Context, store.Storer[T1]) error
}

type YAMLReader added in v0.0.3

type YAMLReader struct {
	Reader io.Reader

	// Path of the file the user is reading
	Path string

	// Client supplied annotations
	Annotations map[string]string

	// allows the consumer to specify its own data store
	DataStore store.Storer[*yaml.RNode]
}

func (*YAMLReader) Read added in v0.0.3

func (r *YAMLReader) Read(ctx context.Context) (store.Storer[*yaml.RNode], error)

type YAMLWriter added in v0.0.3

type YAMLWriter struct {
	Writer io.Writer

	Type OutputSink
	// Could be a file or directory
	Path string
}

func (*YAMLWriter) Write added in v0.0.3

func (r *YAMLWriter) Write(ctx context.Context, datastore store.Storer[*yaml.RNode]) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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