gitee.com/quant1x/gox@v1.21.2/util/internal/serialization.go (about) 1 // Copyright (c) 2015, Emir Pasic. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package internal 6 7 // JSONSerializer provides JSON serialization 8 type JSONSerializer interface { 9 // ToJSON outputs the JSON representation of containers's elements. 10 ToJSON() ([]byte, error) 11 } 12 13 // JSONDeserializer provides JSON deserialization 14 type JSONDeserializer interface { 15 // FromJSON populates containers's elements from the input JSON representation. 16 FromJSON([]byte) error 17 }