Documentation ¶
Index ¶
- Constants
- Variables
- func CheckInvolved(element string, elements ...string) bool
- func GenerateSeqNumbers(r interface{}, seqNumber *SeqNumber) error
- func Marshal(v any) ([]byte, error)
- func MarshalIndent(v any, prefix, indent string) ([]byte, error)
- func NewErrFieldRequired(typeStr string) error
- func NewErrFiledOmitted(typeStr string) error
- func NewErrMinMaxRange(typeStr string) error
- func NewErrValueInvalid(typeStr string) error
- func NumericStringField(s string, max uint) string
- func Ptr[T any](t T) *T
- func Validate(r interface{}, args ...string) error
- func ValidateDateText(str string) bool
- func ValidateNumericCharacters(str string, min, max int) bool
- func ValidateSeqNumbers(r interface{}) (map[SeqNumber]bool, error)
- type DateYYYYMMDDOrBlankType
- type DateYYYYMMDDOrBlankTypeDOB
- type DateYYYYMMDDType
- type DateYYYYType
- type Element
- type ElementActivity
- type RestrictNumeric14
- type RestrictString100
- type RestrictString15
- type RestrictString150
- type RestrictString16
- type RestrictString2
- type RestrictString20
- type RestrictString25
- type RestrictString3
- type RestrictString30
- type RestrictString35
- type RestrictString39
- type RestrictString4
- type RestrictString40
- type RestrictString4000
- type RestrictString50
- type RestrictString512
- type RestrictString517
- type RestrictString525
- type RestrictString6
- type RestrictString750
- type RestrictString9
- type SeqNumber
- type ValidateAccountTypeCodeType
- type ValidateAssetAttributeTypeIDTypeCode
- type ValidateAssetSubtypeIDTypeCode
- type ValidateAssetTypeIDTypeCode
- type ValidateCyberEventIndicatorsTypeCode
- type ValidateEFilingAccountTypeCodeType
- type ValidateElectronicAddressTypeCode
- type ValidateExemptBasisTypeCode
- type ValidateIndicatorNullType
- type ValidateIndicatorType
- type ValidateInstrumentProductServiceTypeCode
- type ValidateLateFilingReasonCodeType
- type ValidateOrganizationCodeType
- type ValidateOrganizationSubtypeCodeCtrType
- type ValidateOrganizationSubtypeCodeSarType
- type ValidatePartyTypeCode
- type ValidatePhoneNumberCodeType
- type ValidateSuspiciousActivitySubtypeID
- type ValidateSuspiciousActivityTypeID
- type ValidateTimeDataOrBlankType
Constants ¶
const ( IndicateLegalName = "L" IndicateDoingBusiness = "DBA" IndicateKnownAs = "AKA" )
const ( ReportSubmission = "SUBMISSION" Report112 = "CTRX" Report111 = "SARX" Report110 = "DOEPX" Report114 = "FBARX" Form8300 = "8300X" NameSpace = "fc2" )
const Version = "v0.3.6"
Variables ¶
var ( DefaultXMLIntent = " " DefaultValidateFunction = "Validate" SequenceFieldName = "SeqNum" )
Functions ¶
func CheckInvolved ¶
func GenerateSeqNumbers ¶ added in v0.2.0
GenerateSeqNumbers generate unique sequence numbers
func Marshal ¶ added in v0.2.7
Marshal will return an error if asked to marshal a channel, function, or map.
func MarshalIndent ¶ added in v0.2.7
MarshalIndent works like Marshal, but each XML element begins on a new indented line that starts with prefix and is followed by one or more copies of indent according to the nesting depth.
func NewErrFieldRequired ¶
NewErrFieldRequired returns an error when a field is required
func NewErrFiledOmitted ¶
NewErrFiledOmitted returns an error that the field should be omitted
func NewErrMinMaxRange ¶
NewErrMinMaxRange returns an error that the field has min/max element range
func NewErrValueInvalid ¶
NewErrTextLength returns an error that the length of value is invalid
func NumericStringField ¶
NumericStringField return number string with filling zero
func ValidateDateText ¶
ValidateDateText check input string is date string (YYYYMMDD)
func ValidateNumericCharacters ¶
ValidateNumericCharacters check input string is numeric characters
func ValidateSeqNumbers ¶ added in v0.2.5
ValidateSeqNumbers verify unique sequence numbers
Types ¶
type DateYYYYMMDDOrBlankType ¶
type DateYYYYMMDDOrBlankType string
Must match the pattern (19|20)[0-9][0-9](0[1-9]|1[0-2])(0[1-9]|1[0-9]|2[0-9]|3[01])|
func (DateYYYYMMDDOrBlankType) Validate ¶
func (r DateYYYYMMDDOrBlankType) Validate() error
type DateYYYYMMDDOrBlankTypeDOB ¶
type DateYYYYMMDDOrBlankTypeDOB string
Must match the pattern (19|20)[0-9][0-9](0[0-9]|1[0-2])(0[0-9]|1[0-9]|2[0-9]|3[01])|
func (DateYYYYMMDDOrBlankTypeDOB) Validate ¶
func (r DateYYYYMMDDOrBlankTypeDOB) Validate() error
type DateYYYYMMDDType ¶
type DateYYYYMMDDType string
Must match the pattern (19|20)[0-9][0-9](0[1-9]|1[0-2])(0[1-9]|1[0-9]|2[0-9]|3[01])
func (DateYYYYMMDDType) Validate ¶
func (r DateYYYYMMDDType) Validate() error
type DateYYYYType ¶
type DateYYYYType string
Must match the pattern (19|20)[0-9][0-9]
func (DateYYYYType) Validate ¶
func (r DateYYYYType) Validate() error
type Element ¶
Element defines interface of complex xml elements args:
1: ActivityPartyTypeCode 2: FilerTypeIndividualIndicator (true/false) 1: disableValidateAttrs (EFilingBatchXML only)
type ElementActivity ¶
type ElementActivity interface { Validate(args ...string) error FormTypeCode() string TotalAmount() float64 PartyCount(args ...string) int64 }
Element defines interface of complex xml elements
type RestrictNumeric14 ¶
type RestrictNumeric14 string
func (RestrictNumeric14) Validate ¶
func (r RestrictNumeric14) Validate() error
type RestrictString100 ¶
type RestrictString100 string
Must match the pattern \S+( +\S+)*|
func (RestrictString100) Validate ¶
func (r RestrictString100) Validate() error
type RestrictString15 ¶
type RestrictString15 string
Must match the pattern \S+( +\S+)*|
func (RestrictString15) Validate ¶
func (r RestrictString15) Validate() error
type RestrictString150 ¶
type RestrictString150 string
Must match the pattern \S+( +\S+)*|
func (RestrictString150) Validate ¶
func (r RestrictString150) Validate() error
type RestrictString16 ¶
type RestrictString16 string
Must match the pattern \S+( +\S+)*|
func (RestrictString16) Validate ¶
func (r RestrictString16) Validate() error
type RestrictString2 ¶
type RestrictString2 string
Must match the pattern \S+( +\S+)*|
func (RestrictString2) Validate ¶
func (r RestrictString2) Validate() error
type RestrictString20 ¶
type RestrictString20 string
Must match the pattern \S+( +\S+)*|
func (RestrictString20) Validate ¶
func (r RestrictString20) Validate() error
type RestrictString25 ¶
type RestrictString25 string
Must match the pattern \S+( +\S+)*|
func (RestrictString25) Validate ¶
func (r RestrictString25) Validate() error
type RestrictString3 ¶
type RestrictString3 string
Must match the pattern \S+( +\S+)*|
func (RestrictString3) Validate ¶
func (r RestrictString3) Validate() error
type RestrictString30 ¶
type RestrictString30 string
Must match the pattern \S+( +\S+)*|
func (RestrictString30) Validate ¶
func (r RestrictString30) Validate() error
type RestrictString35 ¶
type RestrictString35 string
Must match the pattern \S+( +\S+)*|
func (RestrictString35) Validate ¶
func (r RestrictString35) Validate() error
type RestrictString39 ¶
type RestrictString39 string
Must match the pattern \S+( +\S+)*|
func (RestrictString39) Validate ¶
func (r RestrictString39) Validate() error
type RestrictString4 ¶
type RestrictString4 string
Must match the pattern \S+( +\S+)*|
func (RestrictString4) Validate ¶
func (r RestrictString4) Validate() error
type RestrictString40 ¶
type RestrictString40 string
Must match the pattern \S+( +\S+)*|
func (RestrictString40) Validate ¶
func (r RestrictString40) Validate() error
type RestrictString4000 ¶
type RestrictString4000 string
May be no more than 4000 items long
func (RestrictString4000) Validate ¶
func (r RestrictString4000) Validate() error
type RestrictString50 ¶
type RestrictString50 string
Must match the pattern \S+( +\S+)*|
func (RestrictString50) Validate ¶
func (r RestrictString50) Validate() error
type RestrictString512 ¶
type RestrictString512 string
Must match the pattern \S+( +\S+)*|
func (RestrictString512) Validate ¶
func (r RestrictString512) Validate() error
type RestrictString517 ¶
type RestrictString517 string
Must match the pattern \S+( +\S+)*|
func (RestrictString517) Validate ¶
func (r RestrictString517) Validate() error
type RestrictString525 ¶
type RestrictString525 string
Must match the pattern \S+( +\S+)*|
func (RestrictString525) Validate ¶
func (r RestrictString525) Validate() error
type RestrictString6 ¶
type RestrictString6 string
Must match the pattern \S+( +\S+)*|
func (RestrictString6) Validate ¶
func (r RestrictString6) Validate() error
type RestrictString750 ¶
type RestrictString750 string
Must match the pattern \S+( +\S+)*|
func (RestrictString750) Validate ¶
func (r RestrictString750) Validate() error
type RestrictString9 ¶
type RestrictString9 string
Must match the pattern \S+( +\S+)*|
func (RestrictString9) Validate ¶
func (r RestrictString9) Validate() error
type ValidateAccountTypeCodeType ¶
type ValidateAccountTypeCodeType string
May be one of 1, 2, 999
func (ValidateAccountTypeCodeType) Validate ¶
func (r ValidateAccountTypeCodeType) Validate() error
type ValidateAssetAttributeTypeIDTypeCode ¶
type ValidateAssetAttributeTypeIDTypeCode int64
May be one of 1, 2, 3, 4
func (ValidateAssetAttributeTypeIDTypeCode) Validate ¶
func (r ValidateAssetAttributeTypeIDTypeCode) Validate() error
type ValidateAssetSubtypeIDTypeCode ¶
type ValidateAssetSubtypeIDTypeCode int64
May be one of 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 41, 46, 47
func (ValidateAssetSubtypeIDTypeCode) Validate ¶
func (r ValidateAssetSubtypeIDTypeCode) Validate() error
type ValidateAssetTypeIDTypeCode ¶
type ValidateAssetTypeIDTypeCode int64
May be one of 5, 6
func (ValidateAssetTypeIDTypeCode) Validate ¶
func (r ValidateAssetTypeIDTypeCode) Validate() error
type ValidateCyberEventIndicatorsTypeCode ¶
type ValidateCyberEventIndicatorsTypeCode string
May be one of 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 999
func (ValidateCyberEventIndicatorsTypeCode) Validate ¶
func (r ValidateCyberEventIndicatorsTypeCode) Validate() error
type ValidateEFilingAccountTypeCodeType ¶
type ValidateEFilingAccountTypeCodeType string
May be one of 141, 142, 143, 144
func (ValidateEFilingAccountTypeCodeType) Validate ¶
func (r ValidateEFilingAccountTypeCodeType) Validate() error
type ValidateElectronicAddressTypeCode ¶
type ValidateElectronicAddressTypeCode string
May be one of E, U
func (ValidateElectronicAddressTypeCode) Validate ¶
func (r ValidateElectronicAddressTypeCode) Validate() error
type ValidateExemptBasisTypeCode ¶
type ValidateExemptBasisTypeCode string
May be one of C, D, E, F
func (ValidateExemptBasisTypeCode) Validate ¶
func (r ValidateExemptBasisTypeCode) Validate() error
type ValidateIndicatorNullType ¶ added in v0.3.2
type ValidateIndicatorNullType string
May be one of Y
func (ValidateIndicatorNullType) Validate ¶ added in v0.3.2
func (r ValidateIndicatorNullType) Validate() error
type ValidateIndicatorType ¶
type ValidateIndicatorType string
May be one of Y,
func (ValidateIndicatorType) Validate ¶
func (r ValidateIndicatorType) Validate() error
type ValidateInstrumentProductServiceTypeCode ¶
type ValidateInstrumentProductServiceTypeCode int
May be one of 35, 16, 39, 26, 40, 34
func (ValidateInstrumentProductServiceTypeCode) Validate ¶
func (r ValidateInstrumentProductServiceTypeCode) Validate() error
type ValidateLateFilingReasonCodeType ¶
type ValidateLateFilingReasonCodeType string
May be one of 1, 2, 3, 4, 5, 6, 7, 8, 9, 999
func (ValidateLateFilingReasonCodeType) Validate ¶
func (r ValidateLateFilingReasonCodeType) Validate() error
type ValidateOrganizationCodeType ¶
type ValidateOrganizationCodeType int
May be one of 1, 2, 3, 4, 5, 11, 12, 999
func (ValidateOrganizationCodeType) Validate ¶
func (r ValidateOrganizationCodeType) Validate() error
type ValidateOrganizationSubtypeCodeCtrType ¶
type ValidateOrganizationSubtypeCodeCtrType int
May be one of 101, 102, 103, 1999
func (ValidateOrganizationSubtypeCodeCtrType) Validate ¶
func (r ValidateOrganizationSubtypeCodeCtrType) Validate() error
type ValidateOrganizationSubtypeCodeSarType ¶
type ValidateOrganizationSubtypeCodeSarType int
May be one of 101, 102, 103, 503, 504, 508, 513, 514, 535, 528, 529, 533, 534, 539, 540, 541, 542, 1999, 5999
func (ValidateOrganizationSubtypeCodeSarType) Validate ¶
func (r ValidateOrganizationSubtypeCodeSarType) Validate() error
type ValidatePartyTypeCode ¶
type ValidatePartyTypeCode string
May be one of I, O, U
func (ValidatePartyTypeCode) Validate ¶
func (r ValidatePartyTypeCode) Validate() error
type ValidatePhoneNumberCodeType ¶
type ValidatePhoneNumberCodeType string
May be one of F, M, R, W
func (ValidatePhoneNumberCodeType) Validate ¶
func (r ValidatePhoneNumberCodeType) Validate() error
type ValidateSuspiciousActivitySubtypeID ¶
type ValidateSuspiciousActivitySubtypeID int
May be one of 106, 111, 112, 113, 114, 301, 304, 305, 308, 309, 310, 312, 320, 321, 322, 323, 324, 325, 401, 402, 403, 404, 405, 409, 501, 502, 504, 505, 506, 507, 601, 603, 604, 608, 609, 701, 801, 804, 805, 806, 807, 808, 809, 812, 820, 821, 822, 823, 824, 901, 903, 904, 905, 907, 908, 909, 910, 911, 913, 917, 920, 921, 922, 924, 925, 926, 927, 928, 1001, 1003, 1005, 1006, 1007, 1101, 1102, 1201, 1202, 1203, 1204, 1999, 3999, 4999, 5999, 6999, 7999, 8999, 9999, 10999, 11999, 12999
func (ValidateSuspiciousActivitySubtypeID) Validate ¶
func (r ValidateSuspiciousActivitySubtypeID) Validate() error
type ValidateSuspiciousActivityTypeID ¶
type ValidateSuspiciousActivityTypeID int
May be one of 1, 12, 3, 4, 5, 6, 7, 8, 9, 10, 11
func (ValidateSuspiciousActivityTypeID) Validate ¶
func (r ValidateSuspiciousActivityTypeID) Validate() error
type ValidateTimeDataOrBlankType ¶
type ValidateTimeDataOrBlankType string
Must match the pattern ([0-1][0-9]|(2[0-3])):[0-5][0-9]:[0-5][0-9]|
func (ValidateTimeDataOrBlankType) Validate ¶
func (r ValidateTimeDataOrBlankType) Validate() error