utils

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 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 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 PrintChannelTypeTree

func PrintChannelTypeTree(ct *meta.ChannelType, out io.Writer)

PrintChannelTypeTree prints the channel structure

func RecursiveValidateUUIDS

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

RecursiveValidateUUIDS validates UUIDs on a structure recursively

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, CTypes 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.ChannelType

MTypes is a string->ChannelType 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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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