Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultGetFiles ¶
DefaultGetFiles is a default implementation for Object.GetFiles
func DefaultWriteDiff ¶
func DefaultWriteDiff(opts DefaultWriteDiffOpts) error
DefaultWriteDiff is the default implementation for Object.WriteDiff
Types ¶
type DefaultWriteDiffOpts ¶
type DefaultWriteDiffOpts struct {
From Object
WriteDiffOpts
ExcludeFilesPatterns []string
}
type ErrParsingMetadataObject ¶
type ErrParsingMetadataObject interface {
// ObjectName corresponds to metadata object in JSON format
// eg: source, api_limits etc
ObjectName() string
// Filename corresponding to metadata object
// eg: databases.yaml, actions.yaml
Filename() string
// ErrorContext will contain any additional information regarding error
ErrorContext() string
// Unwrap will make sure the error returned is unwrappable
// https://blog.golang.org/go1.13-errors#TOC_3.1.
Unwrap() error
error
}
func NewErrParsingMetadataObject ¶
func NewErrParsingMetadataObject(o Object, err error, context ...string) ErrParsingMetadataObject
type Object ¶
type Object interface {
Build(metadata *yaml.MapSlice) ErrParsingMetadataObject
Export(metadata yaml.MapSlice) (map[string][]byte, ErrParsingMetadataObject)
CreateFiles() error
// GetFiles will return an array of filepaths which make up the metadata object.
// For example the "sources" metadata key is made up of files like
// databases.yaml. which then will have !include tags which will branch to include
// files like databases/<source-name>/tables/tables.yaml
// this function is expected to return the list of all these files which make up the metadata object
GetFiles() ([]string, ErrParsingMetadataObject)
// WriteDiff should be implemented such that it should write the difference
// between the current object and passed in object on the provided writer
WriteDiff(WriteDiffOpts) ErrParsingMetadataObject
Key() string
Filename() string
// BaseDirectory will return the parent directory of `Filename()`
BaseDirectory() string
}
Click to show internal directories.
Click to hide internal directories.