package jsonschemaimport ()// Decoder specifies how to decode specific contentEncoding.typeDecoderstruct {// Name of contentEncoding. Name string// Decode given string to byte array. Decode func(string) ([]byte, error)}var decoders = map[string]*Decoder{"base64": {Name: "base64",Decode: func( string) ([]byte, error) {returnbase64.StdEncoding.DecodeString() }, },}// MediaType specified how to validate bytes against specific contentMediaType.typeMediaTypestruct {// Name of contentMediaType. Name string// Validate checks whether bytes conform to this mediatype. Validate func([]byte) error// UnmarshalJSON unmarshals bytes into json value. // This must be nil if this mediatype is not compatible // with json. UnmarshalJSON func([]byte) (any, error)}var mediaTypes = map[string]*MediaType{"application/json": {Name: "application/json",Validate: func( []byte) error {varanyreturnjson.Unmarshal(, &) },UnmarshalJSON: func( []byte) (any, error) {returnUnmarshalJSON(bytes.NewReader()) }, },}
The pages are generated with Goldsv0.8.7. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.