Documentation
¶
Index ¶
- func NormalizeDAMLType(damlType string) string
- type Any
- type BigNumeric
- type Bool
- type BytesHex
- type ContractId
- type DamlType
- type Date
- type Decimal
- type Enum
- type ExternalPackage
- type ExternalPackages
- type FieldHints
- type GenMap
- type Imported
- type Int64
- type InterfaceMap
- type List
- type Manifest
- type Map
- type Metadata
- type Numeric
- type Optional
- type Package
- type Party
- type RelTime
- type RoundingMode
- type Set
- type Text
- type TextMap
- type Timestamp
- type TmplChoice
- type TmplField
- type TmplStruct
- type Unit
- type Unknown
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NormalizeDAMLType ¶
Types ¶
type Any ¶
type Any struct {
// contains filtered or unexported fields
}
func (Any) GoImport ¶
func (Any) GoImport() *ExternalPackage
type BigNumeric ¶
type BigNumeric struct {
// contains filtered or unexported fields
}
func (BigNumeric) GoImport ¶
func (BigNumeric) GoImport() *ExternalPackage
func (BigNumeric) GoType ¶
func (t BigNumeric) GoType() string
type Bool ¶
type Bool struct {
// contains filtered or unexported fields
}
func (Bool) GoImport ¶
func (Bool) GoImport() *ExternalPackage
type BytesHex ¶
type BytesHex struct {
// contains filtered or unexported fields
}
func (BytesHex) GoImport ¶
func (BytesHex) GoImport() *ExternalPackage
func (BytesHex) IsBytesHex ¶
IsBytesHex returns true - used by template to add hex:"bytes16" tag
type ContractId ¶
type ContractId struct {
// contains filtered or unexported fields
}
func (ContractId) GoImport ¶
func (ContractId) GoImport() *ExternalPackage
func (ContractId) GoType ¶
func (t ContractId) GoType() string
type DamlType ¶
type DamlType interface {
GoType() string
GoImport() *ExternalPackage
}
type Date ¶
type Date struct {
// contains filtered or unexported fields
}
func (Date) GoImport ¶
func (Date) GoImport() *ExternalPackage
type Decimal ¶
type Decimal struct {
// contains filtered or unexported fields
}
func (Decimal) GoImport ¶
func (Decimal) GoImport() *ExternalPackage
type Enum ¶
type Enum struct {
// contains filtered or unexported fields
}
func (Enum) GoImport ¶
func (Enum) GoImport() *ExternalPackage
type ExternalPackage ¶
type ExternalPackages ¶
type ExternalPackages struct {
// Maps packageId => package
Packages map[string]ExternalPackage
}
type FieldHints ¶
type FieldHints struct {
// BytesFields: field names that should receive a hex:"bytes" tag (uint8 length prefix, ≤255 bytes).
BytesFields map[string]bool
// BytesHexFields: field names that should receive a hex:"bytes16" tag (uint16 length prefix).
BytesHexFields map[string]bool
// Uint32Fields: field names where INT64 should be encoded as a 4-byte uint32 (hex:"uint32" tag).
Uint32Fields map[string]bool
// Uint32ListFields: field names where []INT64 should be encoded as []uint32 (hex:"[]uint32" tag).
Uint32ListFields map[string]bool
// VariantTagByteMap: maps fully-qualified variant type name (e.g. "Module.TypeName") to
// a map of constructor names to their numeric tag bytes for MCMS encoding.
// Example: {"MyModule.TransferTimeout": {"Indefinite": 0x00, "RelativeHours": 0x01}}
VariantTagByteMap map[string]map[string]byte
}
FieldHints allows callers to declare which struct field names need non-default hex encoding tags. Because the Daml compiler erases type synonyms (e.g. BytesHex becomes Text in the compiled Daml-LF), go-daml cannot infer the correct encoding from the .dalf alone. Callers that know the encoding semantics of their contracts populate these maps and pass a FieldHints value to CodegenDalfs / GetAST.
An empty (zero-value) FieldHints is valid and means no special encoding is applied.
type GenMap ¶
type GenMap struct {
// contains filtered or unexported fields
}
func (GenMap) GoImport ¶
func (GenMap) GoImport() *ExternalPackage
type Imported ¶
type Imported struct {
Underlying DamlType
ExternalPackage ExternalPackage
}
func (Imported) GoImport ¶
func (t Imported) GoImport() *ExternalPackage
type Int64 ¶
type Int64 struct {
// contains filtered or unexported fields
}
func (Int64) GoImport ¶
func (Int64) GoImport() *ExternalPackage
type InterfaceMap ¶
type InterfaceMap map[string]*TmplStruct
type List ¶
type List struct {
Inner DamlType
}
func (List) GoImport ¶
func (t List) GoImport() *ExternalPackage
type Map ¶
type Map struct {
// contains filtered or unexported fields
}
func (Map) GoImport ¶
func (Map) GoImport() *ExternalPackage
type Numeric ¶
type Numeric struct {
// contains filtered or unexported fields
}
func (Numeric) GoImport ¶
func (Numeric) GoImport() *ExternalPackage
type Optional ¶
type Optional struct {
Inner DamlType
}
func (Optional) GoImport ¶
func (t Optional) GoImport() *ExternalPackage
type Package ¶
type Package struct {
Name string
Version string
PackageID string
Structs map[string]*TmplStruct
Metadata *Metadata
ImportedPackages []ExternalPackage
}
type Party ¶
type Party struct {
// contains filtered or unexported fields
}
func (Party) GoImport ¶
func (Party) GoImport() *ExternalPackage
type RelTime ¶
type RelTime struct {
// contains filtered or unexported fields
}
func (RelTime) GoImport ¶
func (RelTime) GoImport() *ExternalPackage
type RoundingMode ¶
type RoundingMode struct {
// contains filtered or unexported fields
}
func (RoundingMode) GoImport ¶
func (RoundingMode) GoImport() *ExternalPackage
func (RoundingMode) GoType ¶
func (t RoundingMode) GoType() string
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
func (Set) GoImport ¶
func (Set) GoImport() *ExternalPackage
type Text ¶
type Text struct {
// contains filtered or unexported fields
}
func (Text) GoImport ¶
func (Text) GoImport() *ExternalPackage
type TextMap ¶
type TextMap struct {
// contains filtered or unexported fields
}
func (TextMap) GoImport ¶
func (TextMap) GoImport() *ExternalPackage
type Timestamp ¶
type Timestamp struct {
// contains filtered or unexported fields
}
func (Timestamp) GoImport ¶
func (Timestamp) GoImport() *ExternalPackage
type TmplChoice ¶
type TmplChoice struct {
Name string
ArgType DamlType
// ReturnType DamlType // Not used for now
Interface DamlType // If this choice is implementing an interface
InterfaceName string // The Go name of the interface this choice comes from (e.g., "ITransferable")
InterfaceDAMLName string // The original DAML name of the interface (e.g., "Transferable")
}
type TmplField ¶
type TmplField struct {
Type DamlType
Name string
RawType string
IsOptional bool
IsEnum bool
IsBytes bool // True if field should use uint8 length prefix (hex:"bytes" tag)
IsBytesHex bool // True if field should use uint16 length prefix (hex:"bytes16" tag)
IsUint32 bool // True if INT64 field should encode as 4-byte uint32 (hex:"uint32" tag)
IsUint32List bool // True if []INT64 field should encode with 4-byte uint32 elements (hex:"[]uint32" tag)
}
type TmplStruct ¶
type TmplStruct struct {
Name string
DAMLName string
ModuleName string
Fields []*TmplField
RawType string
IsTemplate bool
IsInterface bool
Key *TmplField
Choices []*TmplChoice
Implements []DamlType // Set if this struct implements any interfaces
Signatories []string
Observers []string
Location string
// VariantTagMapping maps variant field names to their numeric tag bytes for MCMS encoding.
// When set, codegen generates GetVariantTagByte() method implementing VariantWithTagByte interface.
VariantTagMapping map[string]byte
}
type Unit ¶
type Unit struct {
// contains filtered or unexported fields
}
func (Unit) GoImport ¶
func (Unit) GoImport() *ExternalPackage
Click to show internal directories.
Click to hide internal directories.