Skip to content

Commit

Permalink
chore: update to latest ffi
Browse files Browse the repository at this point in the history
  • Loading branch information
mefellows committed Aug 21, 2022
1 parent 07bddec commit 2e09eb7
Show file tree
Hide file tree
Showing 3 changed files with 634 additions and 10 deletions.
2 changes: 1 addition & 1 deletion installer/installer.go
Expand Up @@ -341,7 +341,7 @@ const (
var packages = map[string]packageInfo{
FFIPackage: {
libName: "libpact_ffi",
version: "0.3.2",
version: "0.3.8",
semverRange: ">= 0.3.0, < 1.0.0",
},
}
Expand Down
8 changes: 4 additions & 4 deletions internal/native/mock_server.go
Expand Up @@ -108,11 +108,11 @@ void pactffi_with_request(InteractionHandle interaction, const char *method, con
/// Sets header expectations
/// https://docs.rs/pact_mock_server_ffi/0.0.7/pact_mock_server_ffi/fn.with_header.html
void pactffi_with_header(InteractionHandle interaction, int interaction_part, const char *name, int index, const char *value);
void pactffi_with_header_v2(InteractionHandle interaction, int interaction_part, const char *name, int index, const char *value);
/// Sets query string expectation
/// https://docs.rs/pact_mock_server_ffi/0.0.7/pact_mock_server_ffi/fn.with_query_parameter.html
void pactffi_with_query_parameter(InteractionHandle interaction, const char *name, int index, const char *value);
void pactffi_with_query_parameter_v2(InteractionHandle interaction, const char *name, int index, const char *value);
/// Sets the description for the Interaction
// https://docs.rs/pact_mock_server_ffi/0.0.7/pact_mock_server_ffi/fn.with_body.html
Expand Down Expand Up @@ -696,7 +696,7 @@ func (i *Interaction) withHeaders(part interactionType, valueOrMatcher map[strin
cValue := C.CString(value)
defer free(cValue)

C.pactffi_with_header(i.handle, C.int(part), cName, C.int(0), cValue)
C.pactffi_with_header_v2(i.handle, C.int(part), cName, C.int(0), cValue)
}

}
Expand All @@ -715,7 +715,7 @@ func (i *Interaction) WithQuery(valueOrMatcher map[string][]interface{}) *Intera
cValue := C.CString(value)
defer free(cValue)

C.pactffi_with_query_parameter(i.handle, cName, C.int(idx), cValue)
C.pactffi_with_query_parameter_v2(i.handle, cName, C.int(idx), cValue)
}
}

Expand Down

0 comments on commit 2e09eb7

Please sign in to comment.