Documentation
¶
Overview ¶
Package eskipfile implements a DataClient for reading the skipper route definitions from an eskip formatted file when opened.
(See the DataClient interface in the skipper/routing package and the eskip format in the skipper/eskip package.)
Example ¶
package main
import (
"github.com/zalando/skipper/eskipfile"
"github.com/zalando/skipper/proxy"
"github.com/zalando/skipper/routing"
)
func main() {
// open file with a routing table:
dataClient, err := eskipfile.Open("/some/path/to/routing-table.eskip")
if err != nil {
// log.Fatal(err)
return
}
// create routing object:
rt := routing.New(routing.Options{
DataClients: []routing.DataClient{dataClient}})
defer rt.Close()
// create http.Handler:
p := proxy.New(rt, proxy.OptionsNone)
defer p.Close()
}
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
A Client contains the route definitions from an eskip file.
func Open ¶
Opens an eskip file and parses it, returning a DataClient implementation. If reading or parsing the file fails, returns an error.
func (Client) LoadAndParseAll ¶
Click to show internal directories.
Click to hide internal directories.