mirror of
https://github.com/grassrootseconomics/farmstar-survey-backend.git
synced 2024-12-22 23:47:32 +01:00
34 lines
612 B
Go
34 lines
612 B
Go
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()
|
|
}
|