Documentation
¶
Index ¶
- func BasicAuth(handler http.HandlerFunc, username, password, realm string) http.HandlerFunc
- func ToOrderId(id int64) string
- func ToUzOrderId(id int64) string
- type BillbeeHandler
- func (billbee *BillbeeHandler) AttachEmailer(emailAddr string, emailPassword string, smtpHost string, smtpPort string, ...)
- func (billbee *BillbeeHandler) ForwardOrder(order *model.Order) (string, error)
- func (billbee *BillbeeHandler) ForwardUzOrder(order *model.Order, convivium string) (string, error)
- type Emailer
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BasicAuth ¶
func BasicAuth(handler http.HandlerFunc, username, password, realm string) http.HandlerFunc
BasicAuth from https://stackoverflow.com/questions/21936332/idiomatic-way-of-requiring-http-basic-auth-in-go
func ToUzOrderId ¶
Types ¶
type BillbeeHandler ¶
type BillbeeHandler struct { Emailer *Emailer // contains filtered or unexported fields }
BillbeeHandler can forward orders to billbee.
func NewBillbeeHandler ¶
func NewBillbeeHandler(apiKey string, authUsername string, authPassword string, url string) *BillbeeHandler
NewBillbeeHandler instantiates a new forwarder.
func (*BillbeeHandler) AttachEmailer ¶
func (*BillbeeHandler) ForwardOrder ¶
func (billbee *BillbeeHandler) ForwardOrder(order *model.Order) (string, error)
ForwardOrder forwards an order to billbee.
func (*BillbeeHandler) ForwardUzOrder ¶
ForwardOrder forwards an Unterstuetzer order to billbee.
type Server ¶
type Server struct { Db *sql.DB Mutex sync.Mutex BillbeeForwarder *BillbeeHandler BasicAuthUsername string BasicAuthPassword string // contains filtered or unexported fields }
Server implements a REST API server.
func (*Server) AttachBillbeeForwarder ¶
func (*Server) AttachEmailer ¶
func (*Server) ListenAndServe ¶
ListenAndServe starts the HTTP server.
Click to show internal directories.
Click to hide internal directories.