syntax = "proto3";
import "validate/validate.proto";
message Person {
uint64 id = 1 [(validate.rules).uint64.gt = 999];
string email = 2 [(validate.rules).string.email = true];
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
admin: | |
access_log_path: /dev/null | |
address: | |
socket_address: | |
protocol: TCP | |
address: 127.0.0.1 | |
port_value: 8081 | |
static_resources: | |
listeners: | |
- address: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static envoy_data buffer_to_native_data(JNIEnv* env, jobject data) { | |
// keep reference in the JNI. | |
jobject j_data = env->NewGlobalRef(data); | |
envoy_data native_data; | |
native_data.bytes = static_cast<uint8_t*>(env->GetDirectBufferAddress(j_data)); | |
native_data.length = env->GetDirectBufferCapacity(j_data); | |
// releasing function and context that Envoy can trigger. | |
native_data.release = jni_delete_global_ref; | |
native_data.context = j_data; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void ios_on_headers(envoy_headers headers, bool end_stream, void *context) { | |
// reconstituted callback. | |
ios_context *c = (ios_context *)context; | |
EnvoyHTTPCallbacks *callbacks = c->callbacks; | |
// dispatching to user-provided dispatch queue. | |
dispatch_async(callbacks.dispatchQueue, ^{ | |
if (!dispatchable(c->closed, end_stream) || !callbacks.onHeaders) { | |
return; | |
} |
OlderNewer