fixup! rename comm interfaces
This commit is contained in:
parent
4f9734d615
commit
3857e34b52
2 changed files with 4 additions and 4 deletions
|
@ -22,7 +22,7 @@ func init() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
config.ParseConfig(*flagConfig)
|
config.ParseConfig(*flagConfig)
|
||||||
|
|
||||||
comm := comm.InitializeCommProvider()
|
comm := comm.InitCommunicator()
|
||||||
db, err := db.New(config.Config())
|
db, err := db.New(config.Config())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Panicf("failed to initialize database: %v", err)
|
log.Panicf("failed to initialize database: %v", err)
|
||||||
|
|
|
@ -14,7 +14,7 @@ import (
|
||||||
|
|
||||||
"github.com/eternal-flame-AD/yoake/config"
|
"github.com/eternal-flame-AD/yoake/config"
|
||||||
"github.com/eternal-flame-AD/yoake/internal/auth"
|
"github.com/eternal-flame-AD/yoake/internal/auth"
|
||||||
"github.com/eternal-flame-AD/yoake/internal/comm"
|
"github.com/eternal-flame-AD/yoake/internal/comm/model"
|
||||||
"github.com/eternal-flame-AD/yoake/internal/echoerror"
|
"github.com/eternal-flame-AD/yoake/internal/echoerror"
|
||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4"
|
||||||
)
|
)
|
||||||
|
@ -25,7 +25,7 @@ type Handler struct {
|
||||||
respCache *responseCache
|
respCache *responseCache
|
||||||
respCacheMutex sync.RWMutex
|
respCacheMutex sync.RWMutex
|
||||||
refreshPeriod time.Duration
|
refreshPeriod time.Duration
|
||||||
comm *comm.CommProvider
|
comm model.Communicator
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetGradesResponse struct {
|
type GetGradesResponse struct {
|
||||||
|
@ -238,7 +238,7 @@ type responseCache struct {
|
||||||
submissionLastUpdate map[string]time.Time
|
submissionLastUpdate map[string]time.Time
|
||||||
}
|
}
|
||||||
|
|
||||||
func Register(g *echo.Group, comm *comm.CommProvider) (h *Handler, err error) {
|
func Register(g *echo.Group, comm model.Communicator) (h *Handler, err error) {
|
||||||
h = &Handler{conf: config.Config().CanvasLMS, comm: comm}
|
h = &Handler{conf: config.Config().CanvasLMS, comm: comm}
|
||||||
if h.conf.Token == "" {
|
if h.conf.Token == "" {
|
||||||
return nil, errors.New("canvas token not set")
|
return nil, errors.New("canvas token not set")
|
||||||
|
|
Loading…
Add table
Reference in a new issue