protoc-gen-zap

command module
v0.0.0-...-baca2f0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2018 License: MIT Imports: 7 Imported by: 0

README

protoc-gen-zap

Generates code for zap core.ObjectMarshaler from proto messages for faster marshaling and redact sensitive information in logs.

For more info on zap core.ObjectMarshaler, please refer: https://github.com/uber-go/zap/blob/master/zapcore/marshaler.go

Example
  • Open ./example/example.proto
  • Tag the desired field of message with tag zap.redact
    string first_name = 2 [(zap.redact) = true];
    
  • Run following cmd to build zap-gen and generate its .zap file
    go build && protoc -I  ./  --plugin=protoc-gen-zap=protoc-gen-zap  --zap_out=:./example  ./example/example.proto 
    
  • Example.pb.zap.go file is generated in example/example directory

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL