func (c *Client) DeleteSketch(name string, t SketchType) error {
	rt := getRawSketchForSketchType(t)
	rd := &pb.Sketch{Name: &name, Type: &rt}
	_, err := c.client.DeleteSketch(context.Background(), rd)
	if err != nil {
		return err
	}
	return nil
}
DeleteSketch deletes a sketch
package skizze
import (
	"fmt"
	"golang.org/x/net/context"
	"google.golang.org/grpc"
	pb "github.com/skizzehq/goskizze/protobuf"
)
var (
	typeMemb = pb.SketchType_MEMB
	typeFreq = pb.SketchType_FREQ
	typeRank = pb.SketchType_RANK
	typeCard = pb.SketchType_CARD
)
type Client struct {
	opts Options
	conn   *grpc.ClientConn
	client pb.SkizzeClient
}
func Dial(address string, opts Options) (*Client, error) {
	var gOpts []grpc.DialOption
	if opts.Insecure == true {
		gOpts = append(gOpts, grpc.WithInsecure())
	}
	conn, err := grpc.Dial(address, gOpts...)
	if err != nil {
		return nil, fmt.Errorf("Unable to dial Skizze at %v: %v", address, err)
	}
	return &Client{
		opts:   opts,
		conn:   conn,
		client: pb.NewSkizzeClient(conn),
	}, nil
}
func (c *Client) Close() {
	if c.conn != nil {
		c.conn.Close()
	}
}
func (c *Client) ListAll() (ret []*Sketch, err error) {
	reply, err := c.client.ListAll(context.Background(), &pb.Empty{})
	if err != nil {
		return nil, err
	}
	for _, sketch := range reply.GetSketches() {
		ret = append(ret, newSketchFromRaw(sketch))
	}
	return ret, err
}
func (c *Client) ListSketches(t SketchType) (ret []*Sketch, err error) {
	rt := getRawSketchForSketchType(t)
	reply, err := c.client.List(context.Background(), &pb.ListRequest{Type: &rt})
	if err != nil {
		return nil, err
	}
	for _, sketch := range reply.GetSketches() {
		ret = append(ret, newSketchFromRaw(sketch))
	}
	return ret, err
}
func (c *Client) ListDomains() (ret []string, err error) {
	reply, err := c.client.ListDomains(context.Background(), &pb.Empty{})
	if err != nil {
		return nil, err
	}
	return reply.GetNames(), nil
}
func (c *Client) CreateDomain(name string) (*Domain, error) {
	rd := &pb.Domain{Name: &name}
	rd.Sketches = append(rd.Sketches, &pb.Sketch{
		Name: &name,
		Type: &typeMemb,
		Properties: &pb.SketchProperties{
			MaxUniqueItems: &defaultMembUnique,
			ErrorRate:      &defaultMembErrorRate,
		},
	})
	rd.Sketches = append(rd.Sketches, &pb.Sketch{
		Name: &name,
		Type: &typeFreq,
		Properties: &pb.SketchProperties{
			MaxUniqueItems: &defaultFreqUnique,
			ErrorRate:      &defaultFreqErrorRate,
		},
	})
	rd.Sketches = append(rd.Sketches, &pb.Sketch{
		Name: &name,
		Type: &typeRank,
		Properties: &pb.SketchProperties{
			Size: &defaultRankSize,
		},
	})
	rd.Sketches = append(rd.Sketches, &pb.Sketch{
		Name: &name,
		Type: &typeCard,
	})
	reply, err := c.client.CreateDomain(context.Background(), rd)
	if err != nil {
		return nil, err
	}
	return newDomainFromRaw(reply), nil
}
func (c *Client) CreateDomainWithProperties(name string, props *DomainProperties) (*Domain, error) {
	rd := &pb.Domain{Name: &name}
	rd.Sketches = append(rd.Sketches, &pb.Sketch{
		Name:       &name,
		Type:       &typeMemb,
		Properties: newRawPropertiesFromProperties(&props.MembershipProperties),
	})
	rd.Sketches = append(rd.Sketches, &pb.Sketch{
		Name:       &name,
		Type:       &typeFreq,
		Properties: newRawPropertiesFromProperties(&props.FrequencyProperties),
	})
	rd.Sketches = append(rd.Sketches, &pb.Sketch{
		Name:       &name,
		Type:       &typeRank,
		Properties: newRawPropertiesFromProperties(&props.RankingsProperties),
	})
	rd.Sketches = append(rd.Sketches, &pb.Sketch{
		Name: &name,
		Type: &typeCard,
	})
	reply, err := c.client.CreateDomain(context.Background(), rd)
	if err != nil {
		return nil, err
	}
	return newDomainFromRaw(reply), nil
}
func (c *Client) DeleteDomain(name string) error {
	rd := &pb.Domain{Name: &name}
	_, err := c.client.DeleteDomain(context.Background(), rd)
	if err != nil {
		return err
	}
	return nil
}
func (c *Client) GetDomain(name string) (*Domain, error) {
	rd := &pb.Domain{Name: &name}
	reply, err := c.client.GetDomain(context.Background(), rd)
	if err != nil {
		return nil, err
	}
	return newDomainFromRaw(reply), nil
}
func (c *Client) CreateSketch(name string, t SketchType, p *Properties) (*Sketch, error) {
	rt := getRawSketchForSketchType(t)
	rd := &pb.Sketch{Name: &name, Type: &rt, Properties: newRawPropertiesFromProperties(p)}
	reply, err := c.client.CreateSketch(context.Background(), rd)
	if err != nil {
		return nil, err
	}
	return newSketchFromRaw(reply), nil
}