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: dataEncryptor.go
    path of file: ./repos/acra/acrablock
    
    the code of the file until where you have to start completion: package acrablock

import (
	"context"
	"github.com/cossacklabs/acra/acrastruct"
	"github.com/cossacklabs/acra/decryptor/base"
	"github.com/cossacklabs/acra/encryptor"
	"github.com/cossacklabs/acra/encryptor/config"
	"github.com/cossacklabs/acra/keystore"
)

// standaloneEncryptorFilterFunction return true if operation should be applied only if setting configured for
// encryption without any other operations like tokenization/masking
func standaloneEncryptorFilterFunction(setting config.ColumnEncryptionSetting) bool {
	return setting.GetCryptoEnvelope() != config.CryptoEnvelopeTypeAcraBlock || !setting.OnlyEncryption()
}

// DataEncryptor that uses AcraBlocks for encryption
type DataEncryptor struct {
	keyStore               keystore.DataEncryptorKeyStore
	needSkipEncryptionFunc encryptor.CheckFunction
}

// N
    
func (d *DataEncryptor) EncryptWithClientID(clientID, data []byte, setting config.ColumnEncryptionSetting) ([]byte, error) {
	if d.needSkipEncryptionFunc(setting) {
		return data, nil
	}
	// skip already encrypted AcraBlock
	if _, _, err := ExtractAcraBlockFromData(data); err == nil {
		return data, nil
	}
	if setting.ShouldReEncryptAcraStructToAcraBlock() {
		// decrypt AcraStruct to encrypt it with AcraBlock
		if err := acrastruct.ValidateAcraStructLength(data); err == nil {
			dataContext := base.NewDataProcessorContext(d.keyStore)
			accessContext := base.NewAccessContext(base.WithClientID(clientID))
			dataContext.Context = base.SetAccessContextToContext(context.Background(), accessContext)
			decrypted, err := base.DecryptProcessor{}.Process(data, dataContext)
			if err != nil {
				return data, err
			}
			data = decrypted
		}
	}
	keys, err := d.keyStore.GetClientIDSymmetricKey(clientID)
	if err != nil {
		return data, err
	}
	return CreateAcraBlock(data, keys, nil)
}