Package bytes

import "github.com/gonitro/nitro/app/codec/bytes"

Overview ▾

Package bytes provides a bytes codec which does not encode or decode anything

func NewCodec

func NewCodec(c io.ReadWriteCloser) codec.Codec

type Codec

type Codec struct {
    Conn io.ReadWriteCloser

func (*Codec) Close

func (c *Codec) Close() error

func (*Codec) ReadBody

func (c *Codec) ReadBody(b interface{}) error

func (*Codec) ReadHeader

func (c *Codec) ReadHeader(m *codec.Message, t codec.MessageType) error

func (*Codec) String

func (c *Codec) String() string

func (*Codec) Write

func (c *Codec) Write(m *codec.Message, b interface{}) error

type Frame

Frame gives us the ability to define raw data to send over the pipes

type Frame struct {
    Data []byte

type Marshaler

type Marshaler struct{}

func (Marshaler) Marshal

func (n Marshaler) Marshal(v interface{}) ([]byte, error)

func (Marshaler) String

func (n Marshaler) String() string

func (Marshaler) Unmarshal

func (n Marshaler) Unmarshal(d []byte, v interface{}) error

type Message

type Message struct {
    Header map[string]string
    Body   []byte