func KeyGetByID(ctx *Context, id int64) (*Key, error) {
	h := authHeader(ctx.Config.AuthToken)
	s := fmt.Sprintf("user__has__public_key(%d)", id)
	uri := ctx.Config.APIEndpoint(s)
	b, err := doJSON(ctx, "GET", uri, h, nil, nil)
	if err != nil {
		return nil, err
	}
	res := struct {
		D []*Key `json:"d"`
	}{}
	err = json.Unmarshal(b, &res)
	if err != nil {
		return nil, err
	}
	if len(res.D) > 0 {
		return res.D[0], nil
	}
	return nil, errors.New("key not found")
}
KeyGetByID retrives public key with the given id
package resingo
import (
	"encoding/json"
	"errors"
	"fmt"
	"time"
)
type Key struct {
	ID        int64  `json:"id"`
	Title     string `json:"title"`
	PublicKey string `json:"public_key"`
	User      struct {
		ID       int64 `json:"__id"`
		Deferred struct {
			URI string `json:"uri"`
		} `json:"__deferred"`
	} `json:"user"`
	Metadata struct {
		URI  string `json:"uri"`
		Type string `json:"type"`
	} `json:"__metadata"`
	CreatedAt time.Time `json:"created_at"`
}
func KeyGetAll(ctx *Context) ([]*Key, error) {
	h := authHeader(ctx.Config.AuthToken)
	uri := ctx.Config.APIEndpoint("user__has__public_key")
	b, err := doJSON(ctx, "GET", uri, h, nil, nil)
	if err != nil {
		return nil, err
	}
	res := struct {
		D []*Key `json:"d"`
	}{}
	err = json.Unmarshal(b, &res)
	if err != nil {
		return nil, err
	}
	return res.D, nil
}