farmstar-survey-backend/internal/router/router.go

34 lines
612 B
Go
Raw Normal View History

2024-02-05 14:05:28 +01:00
package router
import (
"github.com/grassrootseconomics/farmstar-survey-backend/pkg/ussd"
"github.com/pocketbase/pocketbase"
)
type (
Opts struct {
PB *pocketbase.PocketBase
USSDClient *ussd.USSDClient
}
RouterContainer struct {
PB *pocketbase.PocketBase
ussd *ussd.USSDClient
}
)
func NewRouter(o Opts) *RouterContainer {
return &RouterContainer{
PB: o.PB,
ussd: o.USSDClient,
}
}
func (r *RouterContainer) Bootsrap() {
r.bootstrapRegistrationRoute()
r.bootstrapFarmerSurveyRoute()
r.bootstrapTransactionRoute()
r.bootstrapDistributorRoute()
r.bootstrapRedeemRoute()
}