(secure bool)
| 192 | } |
| 193 | |
| 194 | func grpcTransportCredentials(secure bool) (opt grpc.DialOption, err error) { |
| 195 | var creds credentials.TransportCredentials |
| 196 | if secure { |
| 197 | certPool, err := x509.SystemCertPool() |
| 198 | if err != nil { |
| 199 | return nil, err |
| 200 | } |
| 201 | creds = credentials.NewClientTLSFromCert(certPool, "") |
| 202 | } else { |
| 203 | creds = insecure.NewCredentials() |
| 204 | } |
| 205 | |
| 206 | return grpc.WithTransportCredentials(creds), nil |
| 207 | } |
| 208 | |
| 209 | // parseTime parses a time string that can be: |
| 210 | // - relative: "now", "now-1h", "now-30m", "now-3h30m" |
no outgoing calls
no test coverage detected