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 CleanAppName(name string) string
- func GetApp(appName *sysl.AppName, mod *sysl.Module) *sysl.Application
- func GetAppName(appname *sysl.AppName) string
- func GetRemoteRepoRoot(path string) string
- func GetTypeDetail(t *sysl.Type) (typeName string, typeDetail string)
- func GetTypePrimitiveName(t sysl.Type_Primitive) 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 IsBuiltIn(name string) bool
- func IsRemoteImport(path string) bool
- func IsSameApp(a *sysl.AppName, b *sysl.AppName) bool
- func IsSameCall(a *sysl.Call, b *sysl.Call) bool
- func JoinAppName(name *sysl.AppName) string
- func JoinAppNameParts(parts ...string) string
- func JoinTypePath(path []string) string
- func JoinTypeRef(ref *sysl.ScopedRef) string
- func JoinTypeRefScope(ref *sysl.Scope) string
- 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 SetLogLevel(level string)
- func SplitAppNameParts(appName string) []string
- 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 BuiltInType
- type ChrootFs
- func (fs *ChrootFs) Chmod(name string, mode os.FileMode) error
- func (fs *ChrootFs) Chown(name string, uid, gid int) 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) Root() string
- func (fs *ChrootFs) Stat(name string) (os.FileInfo, error)
- type Exit
- type MockFs
- func (m *MockFs) Chmod(name string, mode os.FileMode) error
- func (m *MockFs) Chown(name string, uid, gid int) 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 ¶
var ( Method_GET = sysl.Endpoint_RestParams_GET.String() Method_PUT = sysl.Endpoint_RestParams_PUT.String() Method_POST = sysl.Endpoint_RestParams_POST.String() Method_DELETE = sysl.Endpoint_RestParams_DELETE.String() Method_PATCH = sysl.Endpoint_RestParams_PATCH.String() )
nolint:revive,stylecheck
var BuiltInTypes = []BuiltInType{ Type_NO_Primitive, Type_EMPTY, Type_ANY, Type_BOOL, Type_INT, Type_INT32, Type_INT64, Type_FLOAT, Type_DECIMAL, Type_STRING, Type_BYTES, Type_STRING_8, Type_DATE, Type_DATETIME, Type_XML, Type_UUID, }
BuiltInTypes are the builtin types of Sysl. There's no primitive int32 (and int64) type. The parser interprets the Sysl syntax int32 value as an int primitive with a bit width (sysl.Type_Constraint.BitWidth) of 32.
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 CleanAppName ¶ added in v0.217.0
func GetAppName ¶
func GetRemoteRepoRoot ¶ added in v0.568.0
func GetTypeDetail ¶
GetTypeDetail returns name of the type and details in string format
func GetTypePrimitiveName ¶ added in v0.344.0
func GetTypePrimitiveName(t sysl.Type_Primitive) string
nolint:interfacer
func HandleCRLF ¶
func HasSameType ¶
HasSameType returns true if type 2 matches with type 1
func IsRemoteImport ¶ added in v0.431.0
func JoinAppName ¶ added in v0.223.0
JoinAppName returns a string with the parts of an app name joined on the namespace separator.
func JoinAppNameParts ¶ added in v0.255.0
JoinAppNameParts returns a string with the parts of an app name joined on the namespace separator.
func JoinTypePath ¶ added in v0.223.0
JoinTypePath returns a string with the parts of a type reference path joined on ".".
func JoinTypeRef ¶ added in v0.258.0
JoinTypeRef returns a string encoding the reference to a type.
If the app name is present it will be joined on " :: " and prefixed to the path, joined by ".".
func JoinTypeRefScope ¶ added in v0.258.0
JoinTypeRefScope returns a string encoding the reference to a type.
If the app name is present it will be joined on " :: " and prefixed to the path, joined by ".".
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 SetLogLevel ¶ added in v0.355.0
func SetLogLevel(level string)
func SplitAppNameParts ¶ added in v0.255.0
SplitAppNameParts returns the parts of an app name that was previously joined into a string.
func WriteToMemOverlayFs ¶
Types ¶
type BuiltInType ¶ added in v0.344.0
type BuiltInType = string
var ( Type_NO_Primitive BuiltInType = GetTypePrimitiveName(sysl.Type_NO_Primitive) Type_EMPTY BuiltInType = GetTypePrimitiveName(sysl.Type_EMPTY) Type_ANY BuiltInType = GetTypePrimitiveName(sysl.Type_ANY) Type_BOOL BuiltInType = GetTypePrimitiveName(sysl.Type_BOOL) Type_INT BuiltInType = GetTypePrimitiveName(sysl.Type_INT) Type_INT32 BuiltInType = "int32" Type_INT64 BuiltInType = "int64" Type_FLOAT BuiltInType = GetTypePrimitiveName(sysl.Type_FLOAT) Type_DECIMAL BuiltInType = GetTypePrimitiveName(sysl.Type_DECIMAL) Type_STRING BuiltInType = GetTypePrimitiveName(sysl.Type_STRING) Type_BYTES BuiltInType = GetTypePrimitiveName(sysl.Type_BYTES) Type_STRING_8 BuiltInType = GetTypePrimitiveName(sysl.Type_STRING_8) Type_DATE BuiltInType = GetTypePrimitiveName(sysl.Type_DATE) Type_DATETIME BuiltInType = GetTypePrimitiveName(sysl.Type_DATETIME) Type_XML BuiltInType = GetTypePrimitiveName(sysl.Type_XML) Type_UUID BuiltInType = GetTypePrimitiveName(sysl.Type_UUID) )
nolint:revive,stylecheck
type ChrootFs ¶
type ChrootFs struct {
// contains filtered or unexported fields
}
func NewChrootFs ¶
NewChrootFs returns a filesystem that is rooted at root argument
type Exit ¶ added in v0.431.0
type Exit struct { Code int // contains filtered or unexported fields }
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.