github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/builtins/types/jsonconcat/jsonconcat.go (about)

     1  package jsonconcat
     2  
     3  import (
     4  	"github.com/lmorg/murex/lang"
     5  	"github.com/lmorg/murex/lang/stdio"
     6  )
     7  
     8  const name = "jsonc"
     9  
    10  func init() {
    11  	// Register data type
    12  	lang.Marshallers[name] = marshal
    13  	lang.Unmarshallers[name] = unmarshal
    14  	lang.ReadIndexes[name] = index
    15  	lang.ReadNotIndexes[name] = index
    16  
    17  	stdio.RegisterReadArray(name, readArray)
    18  	stdio.RegisterReadArrayWithType(name, readArrayWithType)
    19  	//stdio.RegisterReadMap(name, readMap)
    20  	stdio.RegisterWriteArray(name, newArrayWriter)
    21  
    22  	lang.SetMime(name,
    23  		"application/jsonc",
    24  		"application/x-jsonc",
    25  		"text/jsonc",
    26  		"text/x-jsonc",
    27  
    28  		"application/jsonconcat",
    29  		"application/x-jsonconcat",
    30  		"text/jsonconcat",
    31  		"text/x-jsonconcat",
    32  
    33  		"application/concatenated-json",
    34  		"application/x-concatenated-json",
    35  		"text/concatenated-json",
    36  		"text/concatenated-json",
    37  
    38  		"application/jsonseq",
    39  		"application/x-jsonseq",
    40  		"text/jsonseq",
    41  		"text/x-jsonseq",
    42  
    43  		"application/json-seq",
    44  		"application/x-json-seq",
    45  		"text/json-seq",
    46  		"text/x-json-seq",
    47  	)
    48  
    49  	lang.SetFileExtensions(name,
    50  		"jsonc",
    51  		"jsonconcat",
    52  		"concatenated-json",
    53  		"jsons",
    54  		"jsonseq",
    55  		"json-seq",
    56  	)
    57  }