We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In pinc files the user should be able to define new external tags through the external keyword. For example:
external
external PdfSearch = (search: string, limit: int, offset: int) -> array({ filename: string, p: int, highlightText: string, url: string, }) ... let response = #PdfSearch(search: "foo", limit: 20, offset: 0);
A tool (pigen) should then be able to generate external code in a language of your choice. For the example above, it could look like this (in php):
pigen
<?php class PdfSearchResponse { public string $filename; public int $p; public string $highlightText; public string $url; } class PdfSearchExternal extends PincExternal { /** * @return array<PdfSearchResponse> */ abstract protected function run(string $search, int $limit, int $offset): array private function decode(string $request): mixed { // Generated by Pigen. Do not modify! } private function encode(array $response): string { // Generated by Pigen. Do not modify! } private function execute(string $request): void { // Generated by Pigen. Do not modify! $decoded = $this->decode($request); $result = $this->run( $decoded->search, $decoded->limit, $decoded->offset ); $encoded = $this->encode($result); $this->respond($encoded); } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
In pinc files the user should be able to define new external tags through the
external
keyword. For example:A tool (
pigen
) should then be able to generate external code in a language of your choice. For the example above, it could look like this (in php):The text was updated successfully, but these errors were encountered: