MCPcopy
hub / github.com/grpc-ecosystem/grpc-gateway / BytesSlice

Function BytesSlice

runtime/convert.go:194–205  ·  view source on GitHub ↗

BytesSlice converts 'val' where individual bytes sequences, encoded in URL-safe base64 without padding, are separated by 'sep' into a slice of byte slices.

(val, sep string)

Source from the content-addressed store, hash-verified

192// BytesSlice converts 'val' where individual bytes sequences, encoded in URL-safe
193// base64 without padding, are separated by 'sep' into a slice of byte slices.
194func BytesSlice(val, sep string) ([][]byte, error) {
195 s := strings.Split(val, sep)
196 values := make([][]byte, len(s))
197 for i, v := range s {
198 value, err := Bytes(v)
199 if err != nil {
200 return nil, err
201 }
202 values[i] = value
203 }
204 return values, nil
205}
206
207// Timestamp converts the given RFC3339 formatted string into a timestamp.Timestamp.
208func Timestamp(val string) (*timestamppb.Timestamp, error) {

Calls 1

BytesFunction · 0.85

Tested by

no test coverage detected