Esempio n. 1
0
func main() {
	port := config.GetString("host.port")
	logger.Printf("Starting server on: %s", port)
	logger.Fatal(http.ListenAndServe(port, WebApp()))
}
Esempio n. 2
0
	"github.com/clausthrane/futfut/datasources"
	"github.com/clausthrane/futfut/models"
	"io"
	"log"
	"net/http"
	"net/url"
	"os"
	"strings"
)

const (
	httpGET = "GET"
)

var logger = log.New(os.Stdout, " ", log.Ldate|log.Lmicroseconds|log.Lshortfile)
var defaultEndPoint = config.GetString("dsb.endPoint")

type DSBFacade interface {
	GetStations() (chan *models.StationList, chan error)
	GetStation(stationId string) (chan *models.StationList, chan error)
	GetAllTrains() (chan *models.TrainEventList, chan error)
	GetTrains(key string, value string) (chan *models.TrainEventList, chan error)
}

func NewDSBFacade() *DSBApi {
	return &DSBApi{defaultEndPoint}
}

func NewDSBFacadeWithEndpoint(endPoint string) *DSBApi {
	return &DSBApi{endPoint}
}