Skip to content

Repository files navigation

CI codecov Go Reference Go Report Card License

grpc-gateway-csv

A CSV marshaler for grpc-gateway. Implements the runtime.Marshaler interface to render gRPC responses as CSV.

Installation

go get github.com/mgoeppe/grpc-gateway-csv

Usage

Register the marshaler with the grpc-gateway ServeMux:

import csv "github.com/mgoeppe/grpc-gateway-csv"

mux := runtime.NewServeMux(
    runtime.WithMarshalerOption("text/csv", &csv.Marshaler{}),
)

Options

  • RowDelim — row delimiter (default: \n)
  • FieldDelim — field delimiter (default: ;)
  • InnerDelim — delimiter for merged values within a field (default: |)
  • NoHeader — suppress header row
  • Printf — custom format function (e.g., for locale-aware number formatting)

Documentation on grpc-gateway custom marshalers: Customizing Your Gateway.

About

CSV Marshaler

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages