simplewrap

package
v1.3.15 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2022 License: MIT Imports: 4 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurlyWrap added in v1.1.6

func CurlyWrap(
	source interface{},
) string

func CurlyWrapIf added in v1.1.6

func CurlyWrapIf(
	isCurly bool,
	source interface{},
) string

func DoubleQuoteWrapElements added in v0.4.1

func DoubleQuoteWrapElements(
	isSkipQuoteOnlyOnExistence bool,
	inputElements ...string,
) (doubleQuoteWrappedItems []string)

DoubleQuoteWrapElements Returns new empty slice if nil or empty slice given.

Reference : https://play.golang.org/p/s_uN2-ckk2F | https://stackoverflow.com/a/48832120

func DoubleQuoteWrapElementsWithIndexes added in v0.8.0

func DoubleQuoteWrapElementsWithIndexes(
	inputElements ...string,
) (doubleQuoteWrappedItems []string)

DoubleQuoteWrapElementsWithIndexes Returns new empty slice if nil or empty slice given.

func MsgCsvItems added in v0.9.5

func MsgCsvItems(
	msg string,
	csvItems ...interface{},
) string

func MsgWrapMsg added in v0.9.5

func MsgWrapMsg(msg, wrappedMsg string) string

func MsgWrapNumber added in v0.9.5

func MsgWrapNumber(name string, number interface{}) string

func ParenthesisWrap added in v1.1.6

func ParenthesisWrap(
	source interface{},
) string

func ParenthesisWrapIf added in v1.1.6

func ParenthesisWrapIf(
	isSquareWrap bool,
	source interface{},
) string

func SquareWrap added in v1.1.6

func SquareWrap(
	source interface{},
) string

func SquareWrapIf added in v1.1.6

func SquareWrapIf(
	isSquareWrap bool,
	source interface{},
) string

func TitleCurlyMeta added in v1.0.8

func TitleCurlyMeta(
	title,
	value,
	meta interface{},
) string

TitleCurlyMeta

Example :

  • constants.CurlyTitleMetaWrapFormat
  • "%v: {%v} (%v)"

func TitleCurlyWrap added in v1.0.8

func TitleCurlyWrap(
	title, value interface{},
) string

func TitleQuotationMeta added in v1.0.8

func TitleQuotationMeta(
	title,
	value,
	meta interface{},
) string

TitleQuotationMeta

Example :

  • constants.QuotationTitleMetaWrapFormat
  • "%v: \"%v\" (%v)"

func TitleSquare added in v1.0.8

func TitleSquare(
	title, value interface{},
) string

func TitleSquareCsvMeta added in v1.0.8

func TitleSquareCsvMeta(
	title string,
	value interface{},
	metaCsvItems ...interface{},
) string

TitleSquareCsvMeta

Usages TitleSquareMeta to give the final output

Example :

  • Title : [Value] (csv meta items)

func TitleSquareMeta added in v1.0.8

func TitleSquareMeta(
	title,
	value,
	meta interface{},
) string

TitleSquareMeta

Example :

  • constants.SquareTitleMetaWrapFormat
  • "%v: [%v] (%v)"

func TitleSquareMetaUsingFmt added in v1.0.8

func TitleSquareMetaUsingFmt(
	title,
	value,
	meta fmt.Stringer,
) string

func ToJsonName added in v1.1.9

func ToJsonName(source interface{}) string

ToJsonName

Alias for WithDoubleQuoteAny

" + source + " , also take care of any double if available next.

func With

func With(start, end, source string) string

func WithBrackets added in v0.9.4

func WithBrackets(
	source interface{},
) string

WithBrackets

[%v]

func WithBracketsQuotation added in v0.9.4

func WithBracketsQuotation(
	source interface{},
) string

WithBracketsQuotation

[\"%v\"]

func WithCurly added in v0.9.4

func WithCurly(
	source interface{},
) string

WithCurly

{%v}

func WithCurlyQuotation added in v0.9.4

func WithCurlyQuotation(
	source interface{},
) string

WithCurlyQuotation

Example : {\"%v\"}

func WithDoubleQuote added in v0.4.1

func WithDoubleQuote(source string) string

WithDoubleQuote " + source + " , also take care of any double if available next.

func WithDoubleQuoteAny added in v0.8.0

func WithDoubleQuoteAny(source interface{}) string

WithDoubleQuoteAny

Alias for ToJsonName

" + source + " , also take care of any double if available next.

func WithParenthesis added in v0.9.4

func WithParenthesis(
	source interface{},
) string

WithParenthesis

(%v)

func WithParenthesisQuotation added in v0.9.4

func WithParenthesisQuotation(
	source interface{},
) string

WithParenthesisQuotation

(\"%v\")

func WithPtr

func WithPtr(start, end, source *string) *string

func WithSingleQuote added in v0.6.8

func WithSingleQuote(source string) string

WithSingleQuote ' + source + ' , also take care of any double if available next.

func WithStartEnd

func WithStartEnd(wrapper, source string) string

WithStartEnd wrapper + source + wrapper

func WithStartEndPtr

func WithStartEndPtr(wrapper, source *string) *string

WithStartEndPtr wrapper + source + wrapper

Types

This section is empty.

Jump to

Keyboard shortcuts

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