initial commit
This commit is contained in:
23
libs/transit/transit.go
Normal file
23
libs/transit/transit.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package transit
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
valhalla "git.coopgo.io/coopgo-platform/libvalhalla-go"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
type TransitRouting struct {
|
||||
Valhalla *valhalla.Actor
|
||||
}
|
||||
|
||||
func NewTransitRouting(cfg *viper.Viper) (*TransitRouting, error) {
|
||||
config := valhalla.DefaultConfig()
|
||||
actor, err := valhalla.NewActorFromConfig(config)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not initiate valhalla library : %w", err)
|
||||
}
|
||||
return &TransitRouting{
|
||||
Valhalla: actor,
|
||||
}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user