impexp

package
v0.0.0-...-b03fc3e Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2019 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 options for export and import

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 Sets ExportInfo into ExportData

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 Imports data from file

func (*ExportData) ImportCheck

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

ImportCheck Checks if object to import is duplicated in the database

func (*ExportData) PrependObject

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

PrependObject Appends ExportObject to ExportData if necessary

func (*ExportData) UpdateTmpObject

func (e *ExportData) UpdateTmpObject()

UpdateTmpObject removes duplicated objects from the auxiliar array

type ExportInfo

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

ExportInfo info for Export

type ExportObject

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

ExportObject Object for Export

Jump to

Keyboard shortcuts

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