30 lines
408 B
Go
30 lines
408 B
Go
package http
|
|
|
|
import (
|
|
"github.com/kcotugno/tacitus"
|
|
|
|
"net/http"
|
|
)
|
|
|
|
type Mux struct {
|
|
*http.ServeMux
|
|
|
|
TradeHandler TradeHandler
|
|
}
|
|
|
|
type errorResponse struct {
|
|
Error string `json:"error,omitempty"`
|
|
}
|
|
|
|
func NewMux() *Mux {
|
|
m := Mux{ServeMux: http.NewServeMux()}
|
|
|
|
m.Handle("/api/trades/", &m.TradeHandler)
|
|
|
|
return &m
|
|
}
|
|
|
|
func (m *Mux) SetLogger(logger tacitus.Logger) {
|
|
m.TradeHandler.logger = logger
|
|
}
|