initial commit

This commit is contained in:
2025-04-29 06:31:39 +02:00
commit 5f63e312c9
19 changed files with 1458 additions and 0 deletions

23
libs/transit/transit.go Normal file
View 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
}