Beispiel #1
0
func (c *Client) GetFrontends() ([]engine.Frontend, error) {
	data, err := c.Get(c.endpoint("frontends"), url.Values{})
	if err != nil {
		return nil, err
	}
	return engine.FrontendsFromJSON(data)
}
Beispiel #2
0
func (c *Client) TopFrontends(bk *engine.BackendKey, limit int) ([]engine.Frontend, error) {
	values := url.Values{
		"limit": {fmt.Sprintf("%d", limit)},
	}
	if bk != nil {
		values["backendId"] = []string{bk.Id}
	}
	response, err := c.Get(c.endpoint("top", "frontends"), values)
	if err != nil {
		return nil, err
	}
	return engine.FrontendsFromJSON(response)
}