Documentation ¶
Overview ¶
Package eet
Index ¶
- Constants
- Variables
- func NewRequestEnvelope(t *TrzbaType, cert *x509.Certificate, pk *rsa.PrivateKey) ([]byte, error)
- func VerifyResponse(trzba *TrzbaType, respEnv []byte, odpoved *OdpovedType, ...) error
- type BkpDigestType
- type BkpElementType
- type BkpEncodingType
- type BkpType
- type CZDICType
- type CastkaType
- type Client
- type DateTime
- type FikType
- type OdpovedBody
- type OdpovedChybaType
- type OdpovedHlavickaType
- type OdpovedPotvrzeniType
- type OdpovedType
- type OdpovedVarovaniType
- type PkpCipherType
- type PkpDigestType
- type PkpElementType
- type PkpEncodingType
- type PkpType
- type RezimType
- type String20
- type String25
- type TrzbaDataType
- type TrzbaHlavickaType
- type TrzbaKontrolniKodyType
- type TrzbaType
- type UUIDType
Constants ¶
const DateTimeLayout = time.RFC3339
DateTimeLayout is the datetime layout of the EET system.
Variables ¶
var ErrInvalidBKP = errors.New("incorrect response BKP")
ErrInvalidBKP is returned if the response BKP code is different.
var ErrInvalidSOAPMessage = errors.New("SOAP message with an unexpected structure")
ErrInvalidSOAPMessage is returned if a SOAP message has an unexpected structure.
var ErrInvalidUUID = errors.New("invalid UUID value or format")
ErrInvalidUUID is returned if the response UUID is different, or it has invalid format.
var ErrInvalidXMLDigest = errors.New("computed digest differs from the digest in the XML")
ErrInvalidXMLDigest is returned if the referenced computed digest differs from the digest in the XML.
Functions ¶
func NewRequestEnvelope ¶ added in v0.4.0
func NewRequestEnvelope(t *TrzbaType, cert *x509.Certificate, pk *rsa.PrivateKey) ([]byte, error)
NewRequestEnvelope returns a populated and signed SOAP request envelope.
func VerifyResponse ¶ added in v0.4.0
func VerifyResponse(trzba *TrzbaType, respEnv []byte, odpoved *OdpovedType, verifyCert func(*x509.Certificate) error) error
VerifyResponse checks whether the response envelope is valid and is signed by a trusted certificate.
Types ¶
type BkpElementType ¶
type BkpElementType struct { BkpType BkpType `xml:",chardata"` Digest BkpDigestType `xml:"digest,attr"` Encoding BkpEncodingType `xml:"encoding,attr"` }
type BkpType ¶
type BkpType string
Must match the pattern [0-9a-fA-F]{8}-[0-9a-fA-F]{8}-[0-9a-fA-F]{8}-[0-9a-fA-F]{8}-[0-9a-fA-F]{8}
type CastkaType ¶
type CastkaType float64
Must match the pattern ((0|-?[1-9]\d{0,7})\.\d\d|-0\.(0[1-9]|[1-9]\d))
func (CastkaType) MarshalText ¶
func (c CastkaType) MarshalText() ([]byte, error)
MarshalText encodes CastkaType value to the correct form with two decimal places included.
type DateTime ¶
func (DateTime) MarshalText ¶
func (*DateTime) Normalize ¶ added in v0.7.0
func (t *DateTime) Normalize()
Normalize canonicalizes the DateTime data. All DateTime needs to be normalized.
func (*DateTime) UnmarshalText ¶
type FikType ¶
type FikType string
Must match the pattern [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}-[0-9a-fA-F]{2}
type OdpovedBody ¶
type OdpovedBody struct {
Odpoved OdpovedType `xml:"Odpoved"`
}
OdpovedBody represents a SOAP Body of the response envelope.
type OdpovedChybaType ¶
type OdpovedHlavickaType ¶
type OdpovedPotvrzeniType ¶
type OdpovedType ¶
type OdpovedType struct { Hlavicka OdpovedHlavickaType `xml:"Hlavicka,omitempty"` Potvrzeni OdpovedPotvrzeniType `xml:"Potvrzeni,omitempty"` Chyba OdpovedChybaType `xml:"Chyba,omitempty"` Varovani []OdpovedVarovaniType `xml:"Varovani,omitempty"` }
func ParseResponseEnvelope ¶ added in v0.4.0
func ParseResponseEnvelope(env []byte) (*OdpovedType, error)
ParseResponseEnvelope returns a parsed SOAP response envelope.
type OdpovedVarovaniType ¶
type PkpElementType ¶
type PkpElementType struct { PkpType PkpType `xml:",chardata"` Digest PkpDigestType `xml:"digest,attr"` Cipher PkpCipherType `xml:"cipher,attr"` Encoding PkpEncodingType `xml:"encoding,attr"` }
type TrzbaDataType ¶
type TrzbaDataType struct { Dicpopl CZDICType `xml:"dic_popl,attr"` Dicpoverujiciho CZDICType `xml:"dic_poverujiciho,attr,omitempty"` Idprovoz int `xml:"id_provoz,attr"` Idpokl String20 `xml:"id_pokl,attr"` Poradcis String25 `xml:"porad_cis,attr"` Dattrzby DateTime `xml:"dat_trzby,attr"` Celktrzba CastkaType `xml:"celk_trzba,attr"` Zaklnepodldph CastkaType `xml:"zakl_nepodl_dph,attr,omitempty"` Zakldan1 CastkaType `xml:"zakl_dan1,attr,omitempty"` Dan1 CastkaType `xml:"dan1,attr,omitempty"` Zakldan2 CastkaType `xml:"zakl_dan2,attr,omitempty"` Dan2 CastkaType `xml:"dan2,attr,omitempty"` Zakldan3 CastkaType `xml:"zakl_dan3,attr,omitempty"` Dan3 CastkaType `xml:"dan3,attr,omitempty"` Cestsluz CastkaType `xml:"cest_sluz,attr,omitempty"` Pouzitzboz1 CastkaType `xml:"pouzit_zboz1,attr,omitempty"` Pouzitzboz2 CastkaType `xml:"pouzit_zboz2,attr,omitempty"` Pouzitzboz3 CastkaType `xml:"pouzit_zboz3,attr,omitempty"` Urcenocerpzuct CastkaType `xml:"urceno_cerp_zuct,attr,omitempty"` Cerpzuct CastkaType `xml:"cerp_zuct,attr,omitempty"` Rezim RezimType `xml:"rezim,attr"` }
type TrzbaHlavickaType ¶
type TrzbaKontrolniKodyType ¶
type TrzbaKontrolniKodyType struct { Pkp PkpElementType `xml:"pkp"` Bkp BkpElementType `xml:"bkp"` }
type TrzbaType ¶
type TrzbaType struct { Hlavicka TrzbaHlavickaType `xml:"Hlavicka"` Data TrzbaDataType `xml:"Data"` KontrolniKody TrzbaKontrolniKodyType `xml:"KontrolniKody"` }