This repository has been archived on 2022-11-30. You can view files and clone it, but cannot push or open issues or pull requests.
tacitus/http/mux.go
2017-09-25 16:47:09 -07:00

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
}