general

package
v0.75.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 9 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FalseText = BooleanText{
	Text: "false",
}
View Source
var TrueText = BooleanText{
	Text: "true",
}

Functions

func EscapeText added in v0.75.0

func EscapeText(s string) string

EscapeText returns s escaped for use as the inner XML of an element, with the entity references Salesforce writes in metadata.

func RemoveDuplicates

func RemoveDuplicates[T Nameable, S ~[]T](slice *S)

func Tidy

Types

type BooleanText

type BooleanText struct {
	Text string `xml:",chardata"`
}

func BooleanTextValue

func BooleanTextValue(cmd *cobra.Command, flag string) (t *BooleanText)

func (*BooleanText) IsFalse

func (b *BooleanText) IsFalse() bool

func (*BooleanText) IsTrue

func (b *BooleanText) IsTrue() bool

func (BooleanText) MarshalXML

func (b BooleanText) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*BooleanText) String

func (b *BooleanText) String() string

func (*BooleanText) ToBool

func (b *BooleanText) ToBool() bool

type IntegerText

type IntegerText struct {
	Text string `xml:",chardata"`
}

func IntegerValue

func IntegerValue(cmd *cobra.Command, flag string) (t *IntegerText)

type Metadata

type Metadata = metadata.MetadataPointer

type Nameable

type Nameable interface {
	GetName() string
}

type NillableText added in v0.69.0

type NillableText struct {
	TextLiteral
	Nil string
}

NillableText is an element written as <name xsi:nil="true"/> when it has no value. The root element of the metadata declares the xsi namespace.

func (NillableText) MarshalXML added in v0.75.0

func (t NillableText) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*NillableText) UnmarshalXML added in v0.75.0

func (t *NillableText) UnmarshalXML(d *nbioxml.Decoder, start nbioxml.StartElement) error

type TextLiteral

type TextLiteral struct {
	// contains filtered or unexported fields
}

TextLiteral is the text of an element. It holds the element's character data and the inner XML that encodes it. An element read from metadata is written back with the inner XML it was read with, so a CDATA section stays a CDATA section; text set with NewTextLiteral or Set is written escaped with EscapeText. The inner XML is always well-formed: it is either read by the XML decoder or produced by EscapeText.

UnmarshalXML takes github.com/nbio/xml types because metadata files are parsed with that package, while MarshalXML takes encoding/xml types because they are written with encoding/xml. NillableText and TypedText follow the same rule.

func NewTextLiteral added in v0.75.0

func NewTextLiteral(value string) *TextLiteral

NewTextLiteral returns a TextLiteral whose character data is value.

func TextValue

func TextValue(cmd *cobra.Command, flag string) (t *TextLiteral)

func (TextLiteral) MarshalXML added in v0.75.0

func (t TextLiteral) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*TextLiteral) Reformat added in v0.75.0

func (t *TextLiteral) Reformat(format func(string) (string, error)) error

Reformat replaces the character data of the element with the result of applying format to it. The element is unchanged if format returns an error.

func (*TextLiteral) Set added in v0.75.0

func (t *TextLiteral) Set(value string)

Set replaces the character data of the element with value.

func (*TextLiteral) String

func (t *TextLiteral) String() string

String returns the character data of the element. A nil TextLiteral has no character data.

func (*TextLiteral) UnmarshalXML added in v0.75.0

func (t *TextLiteral) UnmarshalXML(d *nbioxml.Decoder, start nbioxml.StartElement) error

type Tidyable

type Tidyable interface {
	Tidy()
}

type TranslationText added in v0.60.0

type TranslationText struct {
	Text    string
	Comment string
}

TranslationText is a translated value in a translation file. Text holds the value with XML entities decoded. Salesforce writes a value that has not been translated as an XML comment holding the untranslated text, such as <label><!-- Account Name --></label>. Text is empty for such a value, and Comment holds the comment's content so the value can be written back unchanged.

UnmarshalXML takes github.com/nbio/xml types because metadata files are parsed with that package, while MarshalXML takes encoding/xml types because they are written with encoding/xml.

func (TranslationText) MarshalXML added in v0.60.0

func (t TranslationText) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*TranslationText) UnmarshalXML added in v0.60.0

func (t *TranslationText) UnmarshalXML(d *nbioxml.Decoder, start nbioxml.StartElement) error

type TypedText added in v0.75.0

type TypedText struct {
	TextLiteral
	Type string
	Nil  string
}

TypedText is a value written with its XML schema type, <value xsi:type="xsd:string">, or as <value xsi:nil="true"/> when it has no value.

func (TypedText) MarshalXML added in v0.75.0

func (t TypedText) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*TypedText) UnmarshalXML added in v0.75.0

func (t *TypedText) UnmarshalXML(d *nbioxml.Decoder, start nbioxml.StartElement) error

Jump to

Keyboard shortcuts

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