Skip to main content
Fragments of a concatenated string containing stringified Tokens.

Initializers

import "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.NewTokenizedStringFragments() TokenizedStringFragments
NameTypeDescription

Methods

NameDescription
AddEscapeNo description.
AddIntrinsicAdds an intrinsic fragment.
AddLiteralAdds a literal fragment.
AddTokenAdds a token fragment.
ConcatNo description.
JoinCombine the string fragments using the given joiner.
MapTokensApply a transformation function to all tokens in the string.

AddEscape

func AddEscape(kind *string)

kindRequired

  • Type: *string

AddIntrinsic

func AddIntrinsic(value interface{})
Adds an intrinsic fragment.

valueRequired

  • Type: interface{}
the intrinsic value to add.

AddLiteral

func AddLiteral(lit interface{})
Adds a literal fragment.

litRequired

  • Type: interface{}
the literal to add.

AddToken

func AddToken(token IResolvable)
Adds a token fragment.

tokenRequired

the token to add.

Concat

func Concat(other TokenizedStringFragments)

otherRequired


Join

func Join(concat IFragmentConcatenator) interface{}
Combine the string fragments using the given joiner. If there are any

concatRequired


MapTokens

func MapTokens(context IResolveContext) TokenizedStringFragments
Apply a transformation function to all tokens in the string.

contextRequired


Properties

NameTypeDescription
Escapes*[]IResolvableReturn all escape fragments from this string.
FirstValueinterface{}Returns the first value.
Intrinsic*[]IResolvableReturn all intrinsic fragments from this string.
Length*f64Returns the number of fragments.
Literals*[]IResolvableReturn all literals from this string.
Tokens*[]IResolvableReturn all Tokens from this string.
FirstTokenIResolvableReturns the first token.

EscapesRequired

func Escapes() *[]IResolvable
Return all escape fragments from this string.

FirstValueRequired

func FirstValue() interface{}
  • Type: interface{}
Returns the first value.

IntrinsicRequired

func Intrinsic() *[]IResolvable
Return all intrinsic fragments from this string.

LengthRequired

func Length() *f64
  • Type: *f64
Returns the number of fragments.

LiteralsRequired

func Literals() *[]IResolvable
Return all literals from this string.

TokensRequired

func Tokens() *[]IResolvable
Return all Tokens from this string.

FirstTokenOptional

func FirstToken() IResolvable
Returns the first token.