firebase.go
func (c *Client) Push(value interface{}, params map[string]string) (*Client, error) {
	body, err := json.Marshal(value)
	if err != nil {
		log.Printf("%v\n", err)
		return nil, err
	}

	res, err := c.api.Call("POST", c.Url, c.Auth, body, params)
	if err != nil {
		return nil, err
	}

	var r map[string]string

	err = json.Unmarshal(res, &r)
	if err != nil {
		log.Printf("%v\n", err)
		return nil, err
	}

	ret := &Client{
		api:   c.api,
		Auth:  c.Auth,
		Url:   c.Url + "/" + r["name"],
		value: value}

	return ret, nil
}
func (c *Client) Push(value interface{}, params map[string]string) (*Client, error) {
	body, err := json.Marshal(value)
	if err != nil {
		log.Printf("%v\n", err)
		return nil, err
	}

	res, err := c.api.Call("POST", c.Url, c.Auth, body, params)
	if err != nil {
		return nil, err
	}

	var r map[string]string

	err = json.Unmarshal(res, &r)
	if err != nil {
		log.Printf("%v\n", err)
		return nil, err
	}

	ret := &Client{
		api:   c.api,
		Auth:  c.Auth,
		Url:   c.Url + "/" + r["name"],
		value: value}

	return ret, nil
}
func ( c * Client ) Push ( value interface { } , params map [ string ] string ) ( * Client , error ) { body , err := json . Marshal ( value ) if err != nil { log . Printf ( " \n " , err ) return nil , err } res , err := c . api . Call ( " " , c . Url , c . Auth , body , params ) if err != nil { return nil , err } var r map [ string ] string err = json . Unmarshal ( res , & r ) if err != nil { log . Printf ( " \n " , err ) return nil , err } ret := & Client { api : c . api , Auth : c . Auth , Url : c . Url + " " + r [ " " ] , value : value } return ret , nil }
// Push creates a new value under the current root url.
// A populated pointer with that value is also returned.
Push creates a new value under the current root url . A populated pointer with that value is also returned .