Merge v1.2.1-master
Signed-off-by: Emile Vauge <emile@vauge.com>
This commit is contained in:
parent
a590155b0b
commit
aeb17182b4
396 changed files with 27271 additions and 9969 deletions
21
vendor/github.com/ArthurHlt/go-eureka-client/LICENSE
generated
vendored
Normal file
21
vendor/github.com/ArthurHlt/go-eureka-client/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2017 Arthur Halet
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
34
vendor/github.com/ArthurHlt/go-eureka-client/eureka/get.go
generated
vendored
34
vendor/github.com/ArthurHlt/go-eureka-client/eureka/get.go
generated
vendored
|
@ -1,11 +1,12 @@
|
|||
package eureka
|
||||
|
||||
import (
|
||||
"encoding/xml"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func (c *Client) GetApplications() (*Applications, error) {
|
||||
response, err := c.Get("apps");
|
||||
response, err := c.Get("apps")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -17,7 +18,7 @@ func (c *Client) GetApplications() (*Applications, error) {
|
|||
func (c *Client) GetApplication(appId string) (*Application, error) {
|
||||
values := []string{"apps", appId}
|
||||
path := strings.Join(values, "/")
|
||||
response, err := c.Get(path);
|
||||
response, err := c.Get(path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -25,14 +26,39 @@ func (c *Client) GetApplication(appId string) (*Application, error) {
|
|||
err = xml.Unmarshal(response.Body, application)
|
||||
return application, err
|
||||
}
|
||||
|
||||
func (c *Client) GetInstance(appId, instanceId string) (*InstanceInfo, error) {
|
||||
values := []string{"apps", appId, instanceId}
|
||||
path := strings.Join(values, "/")
|
||||
response, err := c.Get(path);
|
||||
response, err := c.Get(path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var instance *InstanceInfo = new(InstanceInfo)
|
||||
err = xml.Unmarshal(response.Body, instance)
|
||||
return instance, err
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Client) GetVIP(vipId string) (*Applications, error) {
|
||||
values := []string{"vips", vipId}
|
||||
path := strings.Join(values, "/")
|
||||
response, err := c.Get(path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var applications *Applications = new(Applications)
|
||||
err = xml.Unmarshal(response.Body, applications)
|
||||
return applications, err
|
||||
}
|
||||
|
||||
func (c *Client) GetSVIP(svipId string) (*Applications, error) {
|
||||
values := []string{"svips", svipId}
|
||||
path := strings.Join(values, "/")
|
||||
response, err := c.Get(path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var applications *Applications = new(Applications)
|
||||
err = xml.Unmarshal(response.Body, applications)
|
||||
return applications, err
|
||||
}
|
||||
|
|
4
vendor/github.com/ArthurHlt/go-eureka-client/eureka/requests.go
generated
vendored
4
vendor/github.com/ArthurHlt/go-eureka-client/eureka/requests.go
generated
vendored
|
@ -67,7 +67,7 @@ type InstanceInfo struct {
|
|||
type DataCenterInfo struct {
|
||||
Name string `xml:"name" json:"name"`
|
||||
Class string `xml:"class,attr" json:"@class"`
|
||||
Metadata DataCenterMetadata `xml:"metadata,omitempty" json:"metadata,omitempty"`
|
||||
Metadata *DataCenterMetadata `xml:"metadata,omitempty" json:"metadata,omitempty"`
|
||||
}
|
||||
|
||||
type DataCenterMetadata struct {
|
||||
|
@ -106,6 +106,8 @@ func NewRawRequest(method, relativePath string, body []byte, cancel <-chan bool)
|
|||
func NewInstanceInfo(hostName, app, ip string, port int, ttl uint, isSsl bool) *InstanceInfo {
|
||||
dataCenterInfo := &DataCenterInfo{
|
||||
Name: "MyOwn",
|
||||
Class: "com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo",
|
||||
Metadata: nil,
|
||||
}
|
||||
leaseInfo := &LeaseInfo{
|
||||
EvictionDurationInSecs: ttl,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue