import "github.com/cockroachdb/cockroach/proto" func myHandler(req *http.Request) { h := proto.RequestHeader(req.Header) value := h.Get("X-AUTH-TOKEN") // Use value to authenticate user and process request }
import "github.com/cockroachdb/cockroach/proto" func myHandler(req *http.Request) { h := proto.RequestHeader(req.Header) h.Set("X-SESSION-ID", "123456789") // Send request with updated header }Overall, the go github.com.cockroachdb.cockroach.proto Request Header package library provides a helpful set of tools for handling request headers in CockroachDB.