Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v3
- name: Install webrpc-gen
run: |
curl -o ./webrpc-gen -fLJO https://github.com/webrpc/webrpc/releases/download/v0.11.3/webrpc-gen.linux-amd64
curl -o ./webrpc-gen -fLJO https://github.com/webrpc/webrpc/releases/download/v0.18.6/webrpc-gen.linux-amd64
chmod +x ./webrpc-gen
echo $PWD >> $GITHUB_PATH

Expand Down
15 changes: 8 additions & 7 deletions _examples/hello-webrpc/webapp/client.gen.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// hello-webrpc v1.0.0 e7d03ae5c6db914d3d31a21b762b6c3af1af1a07
// hello-webrpc v1.0.0 4fc01b139e8de5a1eb11b0581cd706326a434708
// --
// Code generated by webrpc-gen@v0.11.3 with custom generator. DO NOT EDIT.
// Code generated by webrpc-gen@v0.18.6 with ../../ generator. DO NOT EDIT.
//
// webrpc-gen -schema=hello-api.ridl -target=../../ -exports=false -client -out=./webapp/client.gen.js

// WebRPC description and code-gen version
export const WebRPCVersion = "v1"
const WebRPCVersion = "v1"

// Schema version of your RIDL schema
export const WebRPCSchemaVersion = "v1.0.0"
const WebRPCSchemaVersion = "v1.0.0"

// Schema hash generated from your RIDL schema
export const WebRPCSchemaHash = "e7d03ae5c6db914d3d31a21b762b6c3af1af1a07"
const WebRPCSchemaHash = "4fc01b139e8de5a1eb11b0581cd706326a434708"

//
// Types
Expand All @@ -27,7 +27,6 @@ class Empty {
constructor(_data) {
this._data = {}
if (_data) {

}
}

Expand All @@ -43,21 +42,23 @@ class User {
this._data['id'] = _data['id']
this._data['USERNAME'] = _data['USERNAME']
this._data['created_at'] = _data['created_at']

}
}

get id() {
return this._data['id']
}
set id(value) {
this._data['id'] = value
}

get USERNAME() {
return this._data['USERNAME']
}
set USERNAME(value) {
this._data['USERNAME'] = value
}

get created_at() {
return this._data['created_at']
}
Expand Down
6 changes: 3 additions & 3 deletions main.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@
// {{.WebrpcGenCommand}}

// WebRPC description and code-gen version
export const WebRPCVersion = "{{.WebrpcVersion}}"
{{if $opts.exports}}export {{end}}const WebRPCVersion = "{{.WebrpcVersion}}"

// Schema version of your RIDL schema
export const WebRPCSchemaVersion = "{{.SchemaVersion}}"
{{if $opts.exports}}export {{end}}const WebRPCSchemaVersion = "{{.SchemaVersion}}"

// Schema hash generated from your RIDL schema
export const WebRPCSchemaHash = "{{.SchemaHash}}"
{{if $opts.exports}}export {{end}}const WebRPCSchemaHash = "{{.SchemaHash}}"

{{template "types" dict "Services" .Services "Types" .Types "Opts" $opts}}
{{- if $opts.client}}
Expand Down