| 1 |
# Interface to test varlink implementations against. |
| 2 |
# First you write a varlink client calling: |
| 3 |
# Start, Test01, Test02, …, Test09, End |
| 4 |
# The return value of the previous call should be the argument of the next call. |
| 5 |
# Then you test this client against well known servers like python or rust from |
| 6 |
# https://github.com/varlink/ |
| 7 |
# |
| 8 |
# Next you write a varlink server providing the same service as the well known ones. |
| 9 |
# Now run your client against it and run well known clients like python or rust |
| 10 |
# from https://github.com/varlink/ against your server. If all works out, then |
| 11 |
# your new language bindings should be varlink certified. |
| 12 |
interface org.varlink.certification |
| 13 |
|
| 14 |
type Interface ( |
| 15 |
foo: ?[]?[string](foo, bar, baz), |
| 16 |
anon: (foo: bool, bar: bool) |
| 17 |
) |
| 18 |
|
| 19 |
type MyType ( |
| 20 |
object: object, |
| 21 |
enum: (one, two, three), |
| 22 |
struct: (first: int, second: string), |
| 23 |
array: []string, |
| 24 |
dictionary: [string]string, |
| 25 |
stringset: [string](), |
| 26 |
nullable: ?string, |
| 27 |
nullable_array_struct: ?[](first: int, second: string), |
| 28 |
interface: Interface |
| 29 |
) |
| 30 |
|
| 31 |
method Start() -> (client_id: string) |
| 32 |
|
| 33 |
method Test01(client_id: string) -> (bool: bool) |
| 34 |
|
| 35 |
method Test02(client_id: string, bool: bool) -> (int: int) |
| 36 |
|
| 37 |
method Test03(client_id: string, int: int) -> (float: float) |
| 38 |
|
| 39 |
method Test04(client_id: string, float: float) -> (string: string) |
| 40 |
|
| 41 |
method Test05(client_id: string, string: string) -> ( |
| 42 |
bool: bool, |
| 43 |
int: int, |
| 44 |
float: float, |
| 45 |
string: string |
| 46 |
) |
| 47 |
|
| 48 |
method Test06( |
| 49 |
client_id: string, |
| 50 |
bool: bool, |
| 51 |
int: int, |
| 52 |
float: float, |
| 53 |
string: string |
| 54 |
) -> ( |
| 55 |
struct: ( |
| 56 |
bool: bool, |
| 57 |
int: int, |
| 58 |
float: float, |
| 59 |
string: string |
| 60 |
) |
| 61 |
) |
| 62 |
|
| 63 |
method Test07( |
| 64 |
client_id: string, |
| 65 |
struct: ( |
| 66 |
bool: bool, |
| 67 |
int: int, |
| 68 |
float: float, |
| 69 |
string: string |
| 70 |
) |
| 71 |
) -> (map: [string]string) |
| 72 |
|
| 73 |
method Test08(client_id: string, map: [string]string) -> (set: [string]()) |
| 74 |
|
| 75 |
method Test09(client_id: string, set: [string]()) -> (mytype: MyType) |
| 76 |
|
| 77 |
# returns more than one reply with "continues" |
| 78 |
method Test10(client_id: string, mytype: MyType) -> (string: string) |
| 79 |
|
| 80 |
# must be called as "oneway" |
| 81 |
method Test11(client_id: string, last_more_replies: []string) -> () |
| 82 |
|
| 83 |
method End(client_id: string) -> (all_ok: bool) |
| 84 |
|
| 85 |
error ClientIdError () |
| 86 |
error CertificationError (wants: object, got: object) |