Codebase list golang-github-go-kit-kit / af73865
refactor(lint/unconvert): remove base64 call returns a string (#717) * refactor(lint/unconvert): remove base64 call returns a string * chore(nats): fix comment on exported function * fix(addsvc): dsl.Request requires an StringMatcher as path mishudark authored 5 years ago Peter Bourgon committed 5 years ago
3 changed file(s) with 3 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
5252 func (w metadataReaderWriter) Set(key, val string) {
5353 key = strings.ToLower(key)
5454 if strings.HasSuffix(key, "-bin") {
55 val = string(base64.StdEncoding.EncodeToString([]byte(val)))
55 val = base64.StdEncoding.EncodeToString([]byte(val))
5656 }
5757 (*w.MD)[key] = append((*w.MD)[key], val)
5858 }
6868 func EncodeKeyValue(key, val string) (string, string) {
6969 key = strings.ToLower(key)
7070 if strings.HasSuffix(key, binHdrSuffix) {
71 v := base64.StdEncoding.EncodeToString([]byte(val))
72 val = string(v)
71 val = base64.StdEncoding.EncodeToString([]byte(val))
7372 }
7473 return key, val
7574 }
1818 timeout time.Duration
1919 }
2020
21 // NewClient constructs a usable Publisher for a single remote method.
21 // NewPublisher constructs a usable Publisher for a single remote method.
2222 func NewPublisher(
2323 publisher *nats.Conn,
2424 subject string,