utils

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const CompilePluginSubFolder = "plugins/compile"

CompilePluginSubFolder plugins complied folder

View Source
const CompileSubFolder = "ebpf/compile"

CompileSubFolder ebpf complied folder

View Source
const PluginSourceSubFolder = "plugins/source"

PluginSourceSubFolder plugin source folder

View Source
const SourceSubFolder = "ebpf/source"

SourceSubFolder ebpf file source folder

View Source
const SpecAPISubFolder = "spec/api"

SpecAPISubFolder spec api sub folder name

View Source
const SpecFileSystemSubFolder = "spec/filesystem"

SpecFileSystemSubFolder spec filesystem sub folder name

Variables

This section is empty.

Functions

func CreateEbpfCompiledFolderIfNotExist

func CreateEbpfCompiledFolderIfNotExist(fm FolderMgr) error

CreateEbpfCompiledFolderIfNotExist create ebpf compiled folder if not exist

func CreateEbpfSourceFolderIfNotExist

func CreateEbpfSourceFolderIfNotExist(fm FolderMgr) error

CreateEbpfSourceFolderIfNotExist create ebpf source folder if not exist

func CreateHomeFolderIfNotExist

func CreateHomeFolderIfNotExist(fm FolderMgr) error

CreateHomeFolderIfNotExist create ebpf home folder if not exist

func CreateKubeKnarkFolders

func CreateKubeKnarkFolders(fm FolderMgr) error

CreateKubeKnarkFolders create kube knark compiled and spec folders

func CreatePluginsCompiledFolderIfNotExist

func CreatePluginsCompiledFolderIfNotExist(fm FolderMgr) error

CreatePluginsCompiledFolderIfNotExist create plugins compiled folder if not exist

func CreatePluginsSourceFolderIfNotExist

func CreatePluginsSourceFolderIfNotExist(fm FolderMgr) error

CreatePluginsSourceFolderIfNotExist plugins source folder if not exist

func CreateSpecAPIFolderIfNotExist

func CreateSpecAPIFolderIfNotExist(fm FolderMgr) error

CreateSpecAPIFolderIfNotExist create spec api folder if not exist

func CreateSpecFSFolderIfNotExist

func CreateSpecFSFolderIfNotExist(fm FolderMgr) error

CreateSpecFSFolderIfNotExist create spec file system folder if not exist

func FindSeverityInt

func FindSeverityInt(severity string) int

FindSeverityInt return severity int value

func GetCompilePluginSubFolder

func GetCompilePluginSubFolder(fm FolderMgr) (string, error)

GetCompilePluginSubFolder return plugin compiled folder path

func GetEbpfCompiledFolder

func GetEbpfCompiledFolder(fm FolderMgr) (string, error)

GetEbpfCompiledFolder return ebpf compiled folder path

func GetEbpfSourceFolder

func GetEbpfSourceFolder(fm FolderMgr) (string, error)

GetEbpfSourceFolder return ebpf source folder path

func GetEnv

func GetEnv(key, fallback string) string

GetEnv Get Environment Variable value or return default

func GetPluginSourceSubFolder

func GetPluginSourceSubFolder(fm FolderMgr) (string, error)

GetPluginSourceSubFolder return plugins source folder path

func GetSpecAPIFolder

func GetSpecAPIFolder(fm FolderMgr) (string, error)

GetSpecAPIFolder return spec api folder path

func GetSpecFilesystemFolder

func GetSpecFilesystemFolder(fm FolderMgr) (string, error)

GetSpecFilesystemFolder return spec file system folder path

Types

type FilesInfo

type FilesInfo struct {
	Name string
	Data string
}

FilesInfo file data

func GetFiles

func GetFiles(folder string) ([]FilesInfo, error)

GetFiles return ebpf source files

type FolderMgr

type FolderMgr interface {
	CreateFolder(folderName string) error
	GetHomeFolder() (string, error)
}

FolderMgr defines the interface for kube-knark folder fileutil.go

func NewKFolder

func NewKFolder() FolderMgr

NewKFolder return KFolder instance

type KFolder

type KFolder struct {
}

KFolder kube-knark folder object

func (KFolder) CreateFolder

func (kf KFolder) CreateFolder(folderName string) error

CreateFolder create new kube knark folder

func (KFolder) GetHomeFolder

func (kf KFolder) GetHomeFolder() (string, error)

GetHomeFolder return kube-knark home folder

Jump to

Keyboard shortcuts

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