You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: rpc_cache.go
    path of file: ./repos/client/go/offline
    
    the code of the file until where you have to start completion: package offline

import (
	"crypto/sha256"
	"encoding/hex"
	"fmt"
	"sync"
	"time"

	"github.com/keybase/client/go/encrypteddb"
	"github.com/keybase/client/go/libkb"
	"github.com/keybase/client/go/msgpack"
	"github.com/keybase/client/go/protocol/keybase1"
	"golang.org/x/net/context"
)

type RPCCache struct {
	sync.Mutex
	edb *encrypteddb.EncryptedDB
}

const (
	bestEffortHandlerTimeout = 500 * time.Millisecond
)

func newEncryptedDB(g *libkb.GlobalContext) *encrypteddb.EncryptedDB {
	keyFn := func(ctx context.Context) ([32]byte
    
func (c *RPCCache) put(mctx libkb.MetaContext, version Version, rpcName string, encrypted bool, arg interface{}, res interface{}) (err error) {
	defer mctx.Trace(fmt.Sprintf("RPCCache#put(%d, %s, %v, %+v)", version, rpcName, encrypted, arg), &err)()
	c.Lock()
	defer c.Unlock()

	dbk, err := dbKey(rpcName, mctx.G().GetMyUID(), arg)
	if err != nil {
		return err
	}

	value := Value{Version: version}
	value.Data, err = msgpack.Encode(res)
	if err != nil {
		return err
	}

	if encrypted {
		err = c.edb.Put(mctx.Ctx(), dbk, value)
	} else {
		err = mctx.G().LocalDb.PutObjMsgpack(dbk, nil, value)
	}
	return err
}