server

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnexpected = errors.New("unexpected error")

ErrUnexpected is returned if unexpected error is raised.

Functions

This section is empty.

Types

type DeleteCertReq added in v0.4.0

type DeleteCertReq struct {
	CertID string `json:"cert_id" binding:"required"`
}

DeleteCertReq is a binding request structure for deleting certificates.

type GatewayErrResp added in v0.4.0

type GatewayErrResp struct {
	GatewayError string `json:"gateway_error"`
}

GatewayErrResp represents an error response structure returned from the EET Gateway API (not from the FSCR).

type Handler

type Handler interface {
	HTTPHandler() http.Handler
}

Handler provides handling options for incoming requests.

func NewHandler

func NewHandler(gatewaySvc gateway.Service) Handler

NewHandler returns an HTTP Handler implementation.

type ListCertIDsResp added in v0.4.0

type ListCertIDsResp struct {
	CertIDs []string `json:"cert_ids"`
}

ListCertIDsResp is a response structure for listing certificate IDs.

type PingEETResp added in v0.4.0

type PingEETResp struct {
	EETGatewayStatus string `json:"eet_gateway"`
	TaxAdminStatus   string `json:"tax_admin"`
	KeystoreStatus   string `json:"keystore"`
}

PingEETResp is a response structure for HTTP pings.

type SendSaleReq added in v0.4.0

type SendSaleReq struct {
	CertID       string `json:"cert_id,omitempty" binding:"required"`
	CertPassword string `json:"cert_password,omitempty" binding:""`

	UUIDZpravy      eet.UUIDType   `json:"uuid_zpravy" binding:"omitempty,uuid_zpravy"`
	DatOdesl        eet.DateTime   `json:"dat_odesl" binding:""`
	PrvniZaslani    bool           `json:"prvni_zaslani" binding:""`
	Overeni         bool           `json:"overeni" binding:""`
	DICPopl         eet.CZDICType  `json:"dic_popl" binding:"required,dic"`
	DICPoverujiciho eet.CZDICType  `json:"dic_poverujiciho" binding:"omitempty,dic,necsfield=Dicpopl"`
	IDProvoz        int            `json:"id_provoz" binding:"required,id_provoz"`
	IDPokl          eet.String20   `json:"id_pokl" binding:"required,id_pokl"`
	PoradCis        eet.String25   `json:"porad_cis" binding:"required,porad_cis"`
	DatTrzby        eet.DateTime   `json:"dat_trzby" binding:""`
	CelkTrzba       eet.CastkaType `json:"celk_trzba" binding:"required,fin_poloz"`
	ZaklNepodlDPH   eet.CastkaType `json:"zakl_nepodl_dph" binding:"omitempty,fin_poloz"`
	ZaklDan1        eet.CastkaType `json:"zakl_dan1" binding:"omitempty,fin_poloz"`
	Dan1            eet.CastkaType `json:"dan1" binding:"omitempty,fin_poloz"`
	ZaklDan2        eet.CastkaType `json:"zakl_dan2" binding:"omitempty,fin_poloz"`
	Dan2            eet.CastkaType `json:"dan2" binding:"omitempty,fin_poloz"`
	ZaklDan3        eet.CastkaType `json:"zakl_dan3" binding:"omitempty,fin_poloz"`
	Dan3            eet.CastkaType `json:"dan3" binding:"omitempty,fin_poloz"`
	CestSluz        eet.CastkaType `json:"cest_sluz" binding:"omitempty,fin_poloz"`
	PouzitZboz1     eet.CastkaType `json:"pouzit_zboz1" binding:"omitempty,fin_poloz"`
	PouzitZboz2     eet.CastkaType `json:"pouzit_zboz2" binding:"omitempty,fin_poloz"`
	PouzitZboz3     eet.CastkaType `json:"pouzit_zboz3" binding:"omitempty,fin_poloz"`
	UrcenoCerpzZuct eet.CastkaType `json:"urceno_cerp_zuct" binding:"omitempty,fin_poloz"`
	CerpZuct        eet.CastkaType `json:"cerp_zuct" binding:"omitempty,fin_poloz"`
	Rezim           eet.RezimType  `json:"rezim" binding:"omitempty,rezim"`
}

SendSaleReq is a binding request structure for sales.

type SendSaleResp added in v0.4.0

type SendSaleResp struct {
	DatOdmit   *eet.DateTime `json:"dat_odmit,omitempty"`
	ChybZprava string        `json:"chyb_zprava,omitempty"`
	ChybKod    int           `json:"chyb_kod,omitempty"`

	DatPrij *eet.DateTime `json:"dat_prij,omitempty"`
	FIK     eet.FikType   `json:"fik,omitempty"`
	BKP     string        `json:"bkp,omitempty"`

	Test     bool                      `json:"test,omitempty"`
	Varovani []eet.OdpovedVarovaniType `json:"varovani,omitempty"`

	Trzba *SendSaleReq `json:"trzba,omitempty"`
}

SendSaleResp is a reponse structure to sale requests.

type Service

type Service interface {
	ListenAndServe(duration time.Duration) error
}

Service is a server of the EET Gateway.

func NewService

func NewService(server *http.Server) Service

NewService returns a Service implementation with the given HTTP server.

type StoreCertReq added in v0.4.0

type StoreCertReq struct {
	CertID       string `json:"cert_id" binding:"required"`
	CertPassword string `json:"cert_password" binding:""`

	PKCS12Data     []byte `json:"pkcs12_data" binding:"required"`
	PKCS12Password string `json:"pkcs12_password" binding:"required"`
}

StoreCertReq is a binding request structure for storing certificates.

type SuccessCertResp added in v0.4.0

type SuccessCertResp struct {
	CertID string `json:"cert_id"`
}

SuccessCertResp is a response of a successful action related to certificate.

type UpdateCertIDReq added in v0.4.0

type UpdateCertIDReq struct {
	CertID string `json:"cert_id" binding:"required"`
	NewID  string `json:"new_id" binding:"required,necsfield=CertID"`
}

UpdateCertIDReq is a binding request structure for certificate ID updates.

type UpdateCertPasswordReq added in v0.4.0

type UpdateCertPasswordReq struct {
	CertID       string `json:"cert_id" binding:"required"`
	CertPassword string `json:"cert_password" binding:"required"`
	NewPassword  string `json:"new_password" binding:"required,necsfield=CertPassword"`
}

UpdateCertPasswordReq is a binding request structure for password updates.

Jump to

Keyboard shortcuts

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