Documentation
¶
Index ¶
- Constants
- func CEP() string
- func CFOP() string
- func CRT() string
- func CSOSN() string
- func CST_COFINS() string
- func CST_PIS() string
- func DhEmi() string
- func DigestValue() string
- func IE() string
- func NCM() string
- func NatOp() string
- func Number(min, max int) string
- func ReplaceTemplate(template string, options ...Option) ([]byte, error)
- func SignatureValue() string
- func UF() string
- func X509Certificate() string
- type CFeGenerator
- type DependencyGraph
- type NFCeGenerator
- type NFeDevolucaoGenerator
- type NFeGenerator
- type Option
- type TemplateGenerator
- type TemplateType
Constants ¶
const CFeXMLMock = `` /* 3219-byte string literal not displayed */
const NFCeXMLMock = `` /* 6408-byte string literal not displayed */
const NFeDevolucaoXMLMock = `` /* 6980-byte string literal not displayed */
const NFeXMLMock = `` /* 5381-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func ReplaceTemplate ¶
ReplaceTemplate takes an XML template and replaces placeholders with mock values. It handles dependencies between placeholders and removes entire tags for blocked placeholders, including any surrounding whitespace and newline characters to prevent blank lines.
func X509Certificate ¶
func X509Certificate() string
X509Certificate generates a mock X509 certificate.
Types ¶
type CFeGenerator ¶
type CFeGenerator struct {
// contains filtered or unexported fields
}
func NewCFeGenerator ¶
func NewCFeGenerator() *CFeGenerator
NewCFeGenerator creates a new instance of CFeGenerator with the CFe XML template.
type DependencyGraph ¶
type NFCeGenerator ¶
type NFCeGenerator struct {
// contains filtered or unexported fields
}
NFCeGenerator generates a NFCe XML.
func NewNFCeGenerator ¶
func NewNFCeGenerator() *NFCeGenerator
NewNFCeGenerator creates a new instance of NFCeGenerator with the NFCe XML template.
type NFeDevolucaoGenerator ¶
type NFeDevolucaoGenerator struct {
// contains filtered or unexported fields
}
NFeDevolucaoGenerator generates an NFe Devolucao XML.
func NewNFeDevolucaoGenerator ¶
func NewNFeDevolucaoGenerator() *NFeDevolucaoGenerator
NewNFeDevolucaoGenerator creates a new instance of NFeDevolucaoGenerator with the NFeDevolucao XML template.
type NFeGenerator ¶
type NFeGenerator struct {
// contains filtered or unexported fields
}
NFeGenerator generates a standard NFe XML.
func NewNFeGenerator ¶
func NewNFeGenerator() *NFeGenerator
NewNFeGenerator creates a new instance of NFeGenerator with the NFe XML template.
type Option ¶
type Option func(*generationConfig)
Option defines a function type for generator configuration options.
func WithBlockedPlaceholders ¶
WithBlockedPlaceholders returns an Option that blocks the specified placeholders.
type TemplateGenerator ¶
TemplateGenerator is an interface for generating XML templates.
func NewTemplateGenerator ¶
func NewTemplateGenerator(templateType TemplateType) (TemplateGenerator, error)
NewTemplateGenerator creates a TemplateGenerator based on the provided TemplateType. It returns an error if the TemplateType is unsupported.
type TemplateType ¶
type TemplateType int
TemplateType is a custom type representing the type of XML template.
const ( // Define the enum values using iota for automatic incrementing. CFe TemplateType = iota NFe NFCe NFeDevolucao )
func ParseTemplateType ¶
func ParseTemplateType(s string) (TemplateType, error)
ParseTemplateType converts a string to a TemplateType enum. It returns an error if the input string does not match any known template type.
func (TemplateType) String ¶
func (tt TemplateType) String() string
String returns the string representation of the TemplateType.