traefik/vendor/github.com/ArthurHlt/go-eureka-client/eureka/post.go
2017-03-09 13:13:02 +01:00

21 lines
377 B
Go

package eureka
import (
"encoding/json"
"strings"
)
func (c *Client) RegisterInstance(appId string, instanceInfo *InstanceInfo) error {
values := []string{"apps", appId}
path := strings.Join(values, "/")
instance := &Instance{
Instance: instanceInfo,
}
body, err := json.Marshal(instance)
if err != nil {
return err
}
_, err = c.Post(path, body)
return err
}