forked from fabiolb/fabio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
backend.go
40 lines (30 loc) · 772 Bytes
/
backend.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Package static implements a simple static registry
// backend which uses statically configured routes.
package static
import "github.com/eBay/fabio/registry"
type be struct{}
var staticRoutes string
func NewBackend(routes string) (registry.Backend, error) {
staticRoutes = routes
return &be{}, nil
}
func (b *be) Register() error {
return nil
}
func (b *be) Deregister() error {
return nil
}
func (b *be) ReadManual() (value string, version uint64, err error) {
return "", 0, nil
}
func (b *be) WriteManual(value string, version uint64) (ok bool, err error) {
return false, nil
}
func (b *be) WatchServices() chan string {
ch := make(chan string, 1)
ch <- staticRoutes
return ch
}
func (b *be) WatchManual() chan string {
return make(chan string)
}