import grpc from 'k6/net/grpc';
import { check } from 'k6';
const client = new grpc.Client();
client.load([], 'authorization.proto', 'route_guide.proto');
export function setup() {
client.connect('auth.googleapis.com:443');
const resp = client.invoke('google.cloud.authorization.v1.AuthService/GetAccessToken', {
username: 'john.smith@k6.io',
password: 'its-a-secret',
});
client.close();
return resp.message.accessToken;
}
export default (token) => {
client.connect('route.googleapis.com:443');
const metadata = {
authorization: `bearer ${token}`,
};
const response = client.invoke(
'google.cloud.route.v1.RoutingService/GetFeature',
{
latitude: 410248224,
longitude: -747127767,
},
{ metadata }
);
check(response, { 'status is OK': (r) => r && r.status === grpc.StatusOK });
client.close();
};
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4