-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3364f3e
commit e97dcb6
Showing
7 changed files
with
92 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/bin/bash | ||
|
||
VERSION="v0.8" | ||
VERSION="v0.9" | ||
DOCKER_REGISTRY="docker.io" | ||
|
||
rm -rf bin | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package etcd_utils | ||
|
||
import ( | ||
"fmt" | ||
etcd_client "github.com/coreos/etcd/client" | ||
"github.com/maxmanuylov/jongleur/jongleur" | ||
"time" | ||
) | ||
|
||
func NewEtcdItemsLoader(period int, etcdEndpoints []string, loader func (etcd_client.Client) ([]string, error)) (jongleur.ItemsLoader, error) { | ||
etcdClient, err := etcd_client.New(etcd_client.Config{ | ||
Endpoints: etcdEndpoints, | ||
Transport: etcd_client.DefaultTransport, | ||
HeaderTimeoutPerRequest: time.Duration(period) * time.Second / 2, | ||
}) | ||
|
||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return func() ([]string, error) { | ||
return loader(etcdClient) | ||
}, nil | ||
} | ||
|
||
func EtcdItemsKey(itemType string) string { | ||
return fmt.Sprintf("/jongleur/items/%s", itemType) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters