|
|
|
@ -55,7 +55,7 @@ struct grpc_lb_policy_factory { |
|
|
|
|
typedef struct grpc_lb_address { |
|
|
|
|
grpc_resolved_address address; |
|
|
|
|
bool is_balancer; |
|
|
|
|
char *balancer_name; /* For secure naming. */ |
|
|
|
|
char *balancer_name; /* For secure naming. */ |
|
|
|
|
void *user_data; |
|
|
|
|
} grpc_lb_address; |
|
|
|
|
|
|
|
|
@ -66,20 +66,20 @@ typedef struct grpc_lb_addresses { |
|
|
|
|
|
|
|
|
|
/** Returns a grpc_addresses struct with enough space for
|
|
|
|
|
* \a num_addresses addresses. */ |
|
|
|
|
grpc_lb_addresses* grpc_lb_addresses_create(size_t num_addresses); |
|
|
|
|
grpc_lb_addresses *grpc_lb_addresses_create(size_t num_addresses); |
|
|
|
|
|
|
|
|
|
/** Sets the value of the address at index \a index of \a addresses.
|
|
|
|
|
* \a address is a socket address of length \a address_len. |
|
|
|
|
* Takes ownership of \a balancer_name. */ |
|
|
|
|
void grpc_lb_addresses_set_address(grpc_lb_addresses *addresses, size_t index, |
|
|
|
|
void *address, size_t address_len, |
|
|
|
|
bool is_balancer, char* balancer_name, |
|
|
|
|
bool is_balancer, char *balancer_name, |
|
|
|
|
void *user_data); |
|
|
|
|
|
|
|
|
|
/** Destroys \a addresses. If \a user_data_destroy is not NULL, it will
|
|
|
|
|
* be invoked to destroy the \a user_data field of each address. */ |
|
|
|
|
void grpc_lb_addresses_destroy(grpc_lb_addresses* addresses, |
|
|
|
|
void (*user_data_destroy)(void*)); |
|
|
|
|
void grpc_lb_addresses_destroy(grpc_lb_addresses *addresses, |
|
|
|
|
void (*user_data_destroy)(void *)); |
|
|
|
|
|
|
|
|
|
/** Arguments passed to LB policies. */ |
|
|
|
|
typedef struct grpc_lb_policy_args { |
|
|
|
|