Skip to content

mus-format/mus-stream-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mus-stream-go

Go Reference GoReportCard codecov

mus-stream-go offers a streaming version of the mus-go serializer, keeping the same structure but using Writer and Reader interfaces instead of byte slices.

How To

More information can be found in the mus-go documentation. Here is just a small example:

package main

import "github.com/mus-format/mus-go/varint"

func main() {
    var (
      num  = 100
      size = varint.Int.Size(num)
      bs   = make([]byte, size)
      buf  = bytes.NewBuffer(bs) // Create a Writer/Reader.
    )
    n, err := varint.Int.Marshal(num, buf)
    // ...
    num, n, err = varint.Int.Unmarshal(buf)
    // ...
}

When working with real connections (e.g., network or file I/O) rather than bytes.Buffer, you must use bufio.Writer and bufio.Reader. This is required because:

  1. They implement the muss.Writer and muss.Reader interfaces.
  2. They provide the necessary buffering for efficient I/O operations.

DTS (Data Type metadata Support)

dts-stream-go enables typed data serialization using DTM.

MarshallerMUS Interface

The MarshallerMUS interface is defined in the ext-stream-go module.

About

MUS format streaming serializer for Go

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages