utils

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AliasNameIsValid

func AliasNameIsValid(name string) error

AliasNameIsValid checks if the given name is valid for naming aliasses

func CompareWithUUID

func CompareWithUUID(first, second interface{}) bool

CompareWithUUID compares two components with their UUIDs

func CompareWithoutUUID

func CompareWithoutUUID(first, second interface{}) bool

CompareWithoutUUID compares two components without comparing their UUID.

func DeepCopy

func DeepCopy(orig, dest interface{}) error

DeepCopy is a copy method for dapps tree structures

func InjectUUID

func InjectUUID(m meta.Metadata) meta.Metadata

InjectUUID injects a new UUID on a metadata

func IsInnerScope

func IsInnerScope(s1, s2 string) bool

IsInnerScope checks if scope s2 is children or the same scope of s1

func IsValidScope

func IsValidScope(scope string) bool

IsValidScope checks if the given scope is of the type 'name1.name2.name3'

func JoinScopes

func JoinScopes(s1, s2 string) (string, error)

JoinScopes join two scopes and return the new scope

func PrintAliasTree

func PrintAliasTree(al *meta.Alias, out io.Writer)

PrintAliasTree prints the alias structure

func PrintAppTree

func PrintAppTree(app *meta.App, out io.Writer)

PrintAppTree prints the app tree

func PrintChannelTree

func PrintChannelTree(ch *meta.Channel, out io.Writer)

PrintChannelTree prints the channel structure

func PrintTypeTree

func PrintTypeTree(t *meta.Type, out io.Writer)

PrintTypeTree prints the channel structure

func RecursiveValidateUUIDS

func RecursiveValidateUUIDS(name string, app *meta.App, t *testing.T)

RecursiveValidateUUIDS validates UUIDs on a structure recursively

func RemoveAliasInScope

func RemoveAliasInScope(scope string) (string, string, error)

RemoveAliasInScope removes the two last names defined in the scope and returns the new scope and the alias that was removed

func RemoveLastPartInScope

func RemoveLastPartInScope(scope string) (string, string, error)

RemoveLastPartInScope removes the last name defined in the scope and returns the new scope and the element that was removed

func StructureNameIsValid

func StructureNameIsValid(name string) error

StructureNameIsValid checks if the given name is valid for naming Channels, types and dApps

func ValidateUUID

func ValidateUUID(uuid string) bool

ValidateUUID validates the formatting of a string to check whether the string contains a proper UUID

Types

type MAliases

type MAliases map[string]*meta.Alias

MAliases is a string->Alias map

type MApps

type MApps map[string]*meta.App

MApps is a string->App map

type MChannels

type MChannels map[string]*meta.Channel

MChannels is a string->channel map

type MStr

type MStr map[string]string

MStr is a string->string map

type MTypes

type MTypes map[string]*meta.Type

MTypes is a string->Type map

type StrSet

type StrSet map[string]bool

StrSet implements a set of strings.

func DisjunctSet

func DisjunctSet(set1, set2 StrSet) StrSet

DisjunctSet returns the disjunction set between two StrSet.

func IntersectSet

func IntersectSet(set1, set2 StrSet) StrSet

IntersectSet returns the intersection set between two StrSet.

func MakeStrSet

func MakeStrSet(obj interface{}) (StrSet, error)

MakeStrSet creates a StrSet from a supported type.

func (*StrSet) AppendSet

func (set *StrSet) AppendSet(target StrSet)

AppendSet extends a StrSet with another StrSet.

func (*StrSet) ToArray

func (set *StrSet) ToArray() utils.StringArray

ToArray returns an array of all items in the set.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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