// Encodes the value v into its AMF3 form.
// If you encode a signed/unsigned int greater than MaxInt, it will be encoded as a double.
// If you encode a signed int less than MinInt, it will be encoded as a double.
Encodes the value v into its AMF3 form.
If you encode a signed/unsigned int greater than MaxInt, it will be encoded as a double.
If you encode a signed int less than MinInt, it will be encoded as a double.
// Encodes the value v into its AMF3 form . // If you encode a signed / unsigned int greater than MaxInt it will be encoded as a double . // If you encode a signed int less than MinInt it will be encoded as a double .
func Encode(v interface{}) ([]byte, error) {
	switch v.(type) {
	case nil:
		return encodeNull(), nil
	case bool:
		return encodeBool(v.(bool)), nil
	case int:
		return encodeInt(v.(int)), nil
	case uint:
		return encodeInt(int(v.(uint))), nil
	case time.Time:
		return encodeDate(v.(time.Time)), nil
	default:
		return nil, errors.New(fmt.Sprintf("cannot encode type %T", v))
	}
}
func Encode ( v interface { } ) ( [ ] byte , error ) { switch v . ( type ) { case nil : return encodeNull ( ) , nil case bool : return encodeBool ( v . ( bool ) ) , nil case int : return encodeInt ( v . ( int ) ) , nil case uint : return encodeInt ( int ( v . ( uint ) ) ) , nil case time . Time : return encodeDate ( v . ( time . Time ) ) , nil default : return nil , errors . New ( fmt . Sprintf ( " " , v ) ) } }
Encodes the value v into its AMF3 form.
Encodes the value v into its AMF3 form .
//case string: //	return encodeString(v.(string)), nil //case []interface{}: // TODO: implement //	return encodeArray(v.([]interface{})), nil //case map[string]interface{}: //	return encodeObject(v.(map[string]interface{})), nil