impexp

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetConfDir

func SetConfDir(dir string)

SetConfDir enable load File Filters from anywhere in the our FS.

func SetDB

func SetDB(db *config.DatabaseCfg)

SetDB load database config to load data if needed (used in filters)

func SetLogger

func SetLogger(l *logrus.Logger)

SetLogger set output log

Types

type EIOptions

type EIOptions struct {
	Recursive   bool   // Export Option
	AutoRename  bool   // Import Option
	AlternateID string // Import Option
}

EIOptions export/import options

type ExportData

type ExportData struct {
	Info    *ExportInfo
	Objects []*ExportObject
	// contains filtered or unexported fields
}

ExportData the runtime measurement config

func NewExport

func NewExport(info *ExportInfo) *ExportData

NewExport ExportData type creator

func (*ExportData) Export

func (e *ExportData) Export(ObjType string, id string, recursive bool, level int) error

Export exports data

func (*ExportData) Import

func (e *ExportData) Import(overwrite bool, autorename bool) error

Import import into the config database data contained in the ExportData struct

func (*ExportData) ImportCheck

func (e *ExportData) ImportCheck() (*ExportData, error)

ImportCheck returns and ExportData type with error summary

func (*ExportData) PrependObject

func (e *ExportData) PrependObject(obj *ExportObject)

PrependObject prepend a new object to the ExportData type

func (*ExportData) UpdateTmpObject

func (e *ExportData) UpdateTmpObject()

UpdateTmpObject update temporaty object

type ExportInfo

type ExportInfo struct {
	FileName      string
	Description   string
	Author        string
	Tags          string
	AgentVersion  string
	ExportVersion string
	CreationDate  time.Time
}

ExportInfo Main export Data type

type ExportObject

type ExportObject struct {
	ObjectTypeID string
	ObjectID     string
	Options      *EIOptions
	ObjectCfg    interface{}
	Error        string
}

ExportObject Base type for any object to export

Jump to

Keyboard shortcuts

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