func (h *kvHandler) Set(ctx thrift.Context, key, value string) error {
	if err := isValidKey(key); err != nil {
		return err
	}

	h.Lock()
	defer h.Unlock()

	h.vals[key] = value
	// Example of how to use response headers. Normally, these values should be passed via result structs.
	ctx.SetResponseHeaders(map[string]string{"count": fmt.Sprint(len(h.vals))})
	return nil
}
func (h *kvHandler) Set(ctx thrift.Context, key, value string) error {
	if err := isValidKey(key); err != nil {
		return err
	}

	h.Lock()
	defer h.Unlock()

	h.vals[key] = value
	
	ctx.SetResponseHeaders(map[string]string{"count": fmt.Sprint(len(h.vals))})
	return nil
}
func ( h * kvHandler ) Set ( ctx thrift . Context , key , value string ) error { if err := isValidKey ( key ) ; err != nil { return err } h . Lock ( ) defer h . Unlock ( ) h . vals [ key ] = value // Example of how to use response headers. Normally, these values should be passed via result structs. ctx . SetResponseHeaders ( map [ string ] string { " " : fmt . Sprint ( len ( h . vals ) ) } ) return nil }
// Set sets the value for a given key.
Set sets the value for a given key .