...

Source file src/github.com/aws/smithy-go/document/json/json.go

Documentation: github.com/aws/smithy-go/document/json

     1  package json
     2  
     3  // NewEncoder returns an Encoder for serializing Smithy documents for JSON based protocols.
     4  func NewEncoder(optFns ...func(options *EncoderOptions)) *Encoder {
     5  	o := EncoderOptions{}
     6  
     7  	for _, fn := range optFns {
     8  		fn(&o)
     9  	}
    10  
    11  	return &Encoder{
    12  		options: o,
    13  	}
    14  }
    15  
    16  // NewDecoder returns a Decoder for deserializing Smithy documents for JSON based protocols.
    17  func NewDecoder(optFns ...func(*DecoderOptions)) *Decoder {
    18  	o := DecoderOptions{}
    19  
    20  	for _, fn := range optFns {
    21  		fn(&o)
    22  	}
    23  
    24  	return &Decoder{
    25  		options: o,
    26  	}
    27  }
    28  

View as plain text