github.com/switchupcb/yaegi@v0.10.2/stdlib/go1_16_encoding_json.go (about)

     1  // Code generated by 'yaegi extract encoding/json'. DO NOT EDIT.
     2  
     3  // +build go1.16,!go1.17
     4  
     5  package stdlib
     6  
     7  import (
     8  	"encoding/json"
     9  	"reflect"
    10  )
    11  
    12  func init() {
    13  	Symbols["encoding/json/json"] = map[string]reflect.Value{
    14  		// function, constant and variable definitions
    15  		"Compact":       reflect.ValueOf(json.Compact),
    16  		"HTMLEscape":    reflect.ValueOf(json.HTMLEscape),
    17  		"Indent":        reflect.ValueOf(json.Indent),
    18  		"Marshal":       reflect.ValueOf(json.Marshal),
    19  		"MarshalIndent": reflect.ValueOf(json.MarshalIndent),
    20  		"NewDecoder":    reflect.ValueOf(json.NewDecoder),
    21  		"NewEncoder":    reflect.ValueOf(json.NewEncoder),
    22  		"Unmarshal":     reflect.ValueOf(json.Unmarshal),
    23  		"Valid":         reflect.ValueOf(json.Valid),
    24  
    25  		// type definitions
    26  		"Decoder":               reflect.ValueOf((*json.Decoder)(nil)),
    27  		"Delim":                 reflect.ValueOf((*json.Delim)(nil)),
    28  		"Encoder":               reflect.ValueOf((*json.Encoder)(nil)),
    29  		"InvalidUTF8Error":      reflect.ValueOf((*json.InvalidUTF8Error)(nil)),
    30  		"InvalidUnmarshalError": reflect.ValueOf((*json.InvalidUnmarshalError)(nil)),
    31  		"Marshaler":             reflect.ValueOf((*json.Marshaler)(nil)),
    32  		"MarshalerError":        reflect.ValueOf((*json.MarshalerError)(nil)),
    33  		"Number":                reflect.ValueOf((*json.Number)(nil)),
    34  		"RawMessage":            reflect.ValueOf((*json.RawMessage)(nil)),
    35  		"SyntaxError":           reflect.ValueOf((*json.SyntaxError)(nil)),
    36  		"Token":                 reflect.ValueOf((*json.Token)(nil)),
    37  		"UnmarshalFieldError":   reflect.ValueOf((*json.UnmarshalFieldError)(nil)),
    38  		"UnmarshalTypeError":    reflect.ValueOf((*json.UnmarshalTypeError)(nil)),
    39  		"Unmarshaler":           reflect.ValueOf((*json.Unmarshaler)(nil)),
    40  		"UnsupportedTypeError":  reflect.ValueOf((*json.UnsupportedTypeError)(nil)),
    41  		"UnsupportedValueError": reflect.ValueOf((*json.UnsupportedValueError)(nil)),
    42  
    43  		// interface wrapper definitions
    44  		"_Marshaler":   reflect.ValueOf((*_encoding_json_Marshaler)(nil)),
    45  		"_Token":       reflect.ValueOf((*_encoding_json_Token)(nil)),
    46  		"_Unmarshaler": reflect.ValueOf((*_encoding_json_Unmarshaler)(nil)),
    47  	}
    48  }
    49  
    50  // _encoding_json_Marshaler is an interface wrapper for Marshaler type
    51  type _encoding_json_Marshaler struct {
    52  	IValue       interface{}
    53  	WMarshalJSON func() ([]byte, error)
    54  }
    55  
    56  func (W _encoding_json_Marshaler) MarshalJSON() ([]byte, error) {
    57  	return W.WMarshalJSON()
    58  }
    59  
    60  // _encoding_json_Token is an interface wrapper for Token type
    61  type _encoding_json_Token struct {
    62  	IValue interface{}
    63  }
    64  
    65  // _encoding_json_Unmarshaler is an interface wrapper for Unmarshaler type
    66  type _encoding_json_Unmarshaler struct {
    67  	IValue         interface{}
    68  	WUnmarshalJSON func(a0 []byte) error
    69  }
    70  
    71  func (W _encoding_json_Unmarshaler) UnmarshalJSON(a0 []byte) error {
    72  	return W.WUnmarshalJSON(a0)
    73  }