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: encode_interface.go
    path of file: ./repos/sealer/vendor/github.com/francoispqt/gojay
    
    the code of the file until where you have to start completion: package gojay

import (
	"fmt"
)

// Encode encodes a value to JSON.
//
// If Encode cannot find a way to encode the type to JSON
// it will return an InvalidMarshalError.
func (enc *Encoder) Encode(v interface{}) error {
	if enc.isPooled == 1 {
		panic(InvalidUsagePooledEncoderError("Invalid usage of pooled encoder"))
	}
	switch vt := v.(type) {
	case string:
		return enc.EncodeString(vt)
	case bool:
		return enc.EncodeBool(vt)
	case MarshalerJSO
    
func (enc *Encoder) AddInterfaceKey(key string, value interface{}) {
	switch vt := value.(type) {
	case string:
		enc.AddStringKey(key, vt)
	case bool:
		enc.AddBoolKey(key, vt)
	case MarshalerJSONArray:
		enc.AddArrayKey(key, vt)
	case MarshalerJSONObject:
		enc.AddObjectKey(key, vt)
	case int:
		enc.AddIntKey(key, vt)
	case int64:
		enc.AddIntKey(key, int(vt))
	case int32:
		enc.AddIntKey(key, int(vt))
	case int16:
		enc.AddIntKey(key, int(vt))
	case int8:
		enc.AddIntKey(key, int(vt))
	case uint64:
		enc.AddIntKey(key, int(vt))
	case uint32:
		enc.AddIntKey(key, int(vt))
	case uint16:
		enc.AddIntKey(key, int(vt))
	case uint8:
		enc.AddIntKey(key, int(vt))
	case float64:
		enc.AddFloatKey(key, vt)
	case float32:
		enc.AddFloat32Key(key, vt)
	default:
		if vt != nil {
			enc.err = InvalidMarshalError(fmt.Sprintf(invalidMarshalErrorMsg, vt))
			return
		}
		return
	}
}