syslutil

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

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,
}

LogLevels ... nolint:gochecknoglobals

Functions

func Assert added in v0.3.0

func Assert(ok bool, format string, args ...interface{})

func GetApp

func GetApp(appName *sysl.AppName, mod *sysl.Module) *sysl.Application

func GetAppName

func GetAppName(appname *sysl.AppName) string

func GetTypeDetail added in v0.3.0

func GetTypeDetail(t *sysl.Type) (typeName string, typeDetail string)

GetTypeDetail returns name of the type and details in string format

func HasPattern

func HasPattern(attrs map[string]*sysl.Attribute, pattern string) bool

func HasSameType added in v0.3.0

func HasSameType(type1 *sysl.Type, type2 *sysl.Type) bool

HasSameType returns true if type 2 matches with type 1

func IsSameApp

func IsSameApp(a *sysl.AppName, b *sysl.AppName) bool

func IsSameCall

func IsSameCall(a *sysl.Call, b *sysl.Call) bool

func PanicOnError added in v0.3.0

func PanicOnError(err error)

func PanicOnErrorf added in v0.3.0

func PanicOnErrorf(err error, format string, args ...interface{})

func TypeBool added in v0.3.0

func TypeBool() *sysl.Type

TypeBool returns boolean type

func TypeDecimal added in v0.3.0

func TypeDecimal() *sysl.Type

TypeDecimal returns decimal type

func TypeEmpty added in v0.3.0

func TypeEmpty() *sysl.Type

TypeEmpty returns empty primitive type

func TypeFloat added in v0.3.0

func TypeFloat() *sysl.Type

TypeFloat returns float type

func TypeInt added in v0.3.0

func TypeInt() *sysl.Type

TypeInt returns integer type

func TypeNone added in v0.3.0

func TypeNone() *sysl.Type

TypeNone returns none-type

func TypeString added in v0.3.0

func TypeString() *sysl.Type

TypeString returns string type

Types

type StrSet added in v0.3.0

type StrSet map[string]struct{}

func MakeStrSet added in v0.3.0

func MakeStrSet(initial ...string) StrSet

func MakeStrSetFromActionStatement added in v0.3.0

func MakeStrSetFromActionStatement(stmts []*sysl.Statement) StrSet

func MakeStrSetFromAttr added in v0.3.0

func MakeStrSetFromAttr(attr string, attrs map[string]*sysl.Attribute) StrSet

func (StrSet) Clone added in v0.3.0

func (s StrSet) Clone() StrSet

func (StrSet) Contains added in v0.3.0

func (s StrSet) Contains(elem string) bool

func (StrSet) Difference added in v0.3.0

func (s StrSet) Difference(other StrSet) StrSet

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) Insert added in v0.3.0

func (s StrSet) Insert(elem string)

func (StrSet) Intersection added in v0.3.0

func (s StrSet) Intersection(other StrSet) StrSet

func (StrSet) IsSubset added in v0.3.0

func (s StrSet) IsSubset(parent StrSet) bool

Returns true if child set is a subset of parent set

func (StrSet) Remove added in v0.3.0

func (s StrSet) Remove(elem string)

func (StrSet) ToSlice added in v0.3.0

func (s StrSet) ToSlice() []string

func (StrSet) ToSortedSlice added in v0.3.0

func (s StrSet) ToSortedSlice() []string

func (StrSet) Union added in v0.3.0

func (s StrSet) Union(other StrSet) StrSet

Jump to

Keyboard shortcuts

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