Documentation ¶
Index ¶
- Variables
- func Assert(ok bool, format string, args ...interface{})
- func AssertFsHasExactly(t *testing.T, fs afero.Fs, paths ...string) bool
- func BuildFolderTest(t *testing.T, fs afero.Fs, folders, files []string)
- func GetApp(appName *sysl.AppName, mod *sysl.Module) *sysl.Application
- func GetAppName(appname *sysl.AppName) string
- func GetTypeDetail(t *sysl.Type) (typeName string, typeDetail string)
- func HandleCRLF(text []byte) []byte
- func HasPattern(attrs map[string]*sysl.Attribute, pattern string) bool
- func HasSameType(type1 *sysl.Type, type2 *sysl.Type) bool
- func IsSameApp(a *sysl.AppName, b *sysl.AppName) bool
- func IsSameCall(a *sysl.Call, b *sysl.Call) bool
- func MustAbsolute(t *testing.T, path string) string
- func MustRelative(t *testing.T, base, target string) string
- func NewMockChrootFs(root string) (*MockFs, *ChrootFs)
- func PanicOnError(err error)
- func PanicOnErrorf(err error, format string, args ...interface{})
- func PopulateCMDFlagsFromFile(cmdArgs []string) ([]string, error)
- func ReadCMDFlags(configPath string) ([]string, error)
- func TypeBool() *sysl.Type
- func TypeDecimal() *sysl.Type
- func TypeEmpty() *sysl.Type
- func TypeFloat() *sysl.Type
- func TypeInt() *sysl.Type
- func TypeNone() *sysl.Type
- func TypeString() *sysl.Type
- func WriteToMemOverlayFs(osRoot string) (memFs, fs afero.Fs)
- type ChrootFs
- func (fs *ChrootFs) Chmod(name string, mode os.FileMode) error
- func (fs *ChrootFs) Chtimes(name string, atime time.Time, mtime time.Time) error
- func (fs *ChrootFs) Create(name string) (afero.File, error)
- func (fs *ChrootFs) Mkdir(name string, perm os.FileMode) error
- func (fs *ChrootFs) MkdirAll(path string, perm os.FileMode) error
- func (fs *ChrootFs) Name() string
- func (fs *ChrootFs) Open(name string) (afero.File, error)
- func (fs *ChrootFs) OpenFile(name string, flag int, perm os.FileMode) (afero.File, error)
- func (fs *ChrootFs) Remove(name string) error
- func (fs *ChrootFs) RemoveAll(path string) error
- func (fs *ChrootFs) Rename(oldname, newname string) error
- func (fs *ChrootFs) Stat(name string) (os.FileInfo, error)
- type MockFs
- func (m *MockFs) Chmod(name string, mode os.FileMode) error
- func (m *MockFs) Chtimes(name string, atime time.Time, mtime time.Time) error
- func (m *MockFs) Create(name string) (afero.File, error)
- func (m *MockFs) Mkdir(name string, perm os.FileMode) error
- func (m *MockFs) MkdirAll(name string, perm os.FileMode) error
- func (m *MockFs) Name() string
- func (m *MockFs) Open(name string) (afero.File, error)
- func (m *MockFs) OpenFile(name string, flag int, perm os.FileMode) (afero.File, error)
- func (m *MockFs) Remove(name string) error
- func (m *MockFs) RemoveAll(path string) error
- func (m *MockFs) Rename(oldname, newname string) error
- func (m *MockFs) Stat(name string) (os.FileInfo, error)
- type StrSet
- func (s StrSet) Clone() StrSet
- func (s StrSet) Contains(elem string) bool
- func (s StrSet) Difference(other StrSet) StrSet
- func (s StrSet) Insert(elem string)
- func (s StrSet) Intersection(other StrSet) StrSet
- func (s StrSet) IsSubset(parent StrSet) bool
- func (s StrSet) Remove(elem string)
- func (s StrSet) ToSlice() []string
- func (s StrSet) ToSortedSlice() []string
- func (s StrSet) Union(other StrSet) StrSet
Constants ¶
This section is empty.
Variables ¶
View Source
var LogLevels = map[string]logrus.Level{ "": logrus.ErrorLevel, "off": logrus.ErrorLevel, "debug": logrus.DebugLevel, "info": logrus.InfoLevel, "warn": logrus.WarnLevel, "trace": logrus.TraceLevel, }
LogLevels ... nolint:gochecknoglobals
Functions ¶
func AssertFsHasExactly ¶
AssertFsHasExactly asserts that fs contains the given files and only those. All paths must start with '/'.
func GetAppName ¶
func GetTypeDetail ¶
GetTypeDetail returns name of the type and details in string format
func HandleCRLF ¶
func HasSameType ¶
HasSameType returns true if type 2 matches with type 1
func NewMockChrootFs ¶
NewMockFs creates a wrapper fs to record function calls with the mock library, it requires a memory map fs
func PanicOnError ¶
func PanicOnError(err error)
func PanicOnErrorf ¶
func PopulateCMDFlagsFromFile ¶ added in v0.8.0
func ReadCMDFlags ¶ added in v0.8.0
func WriteToMemOverlayFs ¶
Types ¶
type ChrootFs ¶
type ChrootFs struct {
// contains filtered or unexported fields
}
func NewChrootFs ¶
NewChrootFs returns a filesystem that is rooted at root argument
type StrSet ¶
type StrSet map[string]struct{}
func MakeStrSet ¶
func MakeStrSetFromAttr ¶
func (StrSet) Difference ¶
Returns the elements that only belong to s. If s is subset of other, it would return an empty set. Just be aware that output may be one of the inputs and when change the output, the input would also be changed.
func (StrSet) Intersection ¶
func (StrSet) ToSortedSlice ¶
Click to show internal directories.
Click to hide internal directories.