Skip to content

Commit

Permalink
fix github action
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsannm committed Jun 13, 2024
1 parent 74e6cf8 commit 4d888bf
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 108 deletions.
12 changes: 2 additions & 10 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,11 @@ jobs:
name: Set up Go ${{ matrix.go }}
steps:
- uses: actions/checkout@v4
- name: Test
uses: actions/setup-go@v4
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
- name: Run Tests
run: |
go work init
go work use ./kit
go work use ./std/gateways/fasthttp
go work use ./std/gateways/fastws
go work use ./std/gateways/silverhttp
go work use ./std/clusters/rediscluster
go work use ./contrib
go work sync
go test -v -race -cover -covermode=atomic -coverprofile=coverage.out -count=1 \
./kit/... \
./std/gateways/fasthttp/... \
Expand Down
199 changes: 101 additions & 98 deletions example/ex-04-stubgen/stub/sampleservicets/stub.ts
Original file line number Diff line number Diff line change
@@ -1,157 +1,160 @@
// Code generated by RonyKIT Stub Generator (TypeScript); DO NOT EDIT.

// @ts-ignore
import useSWR, {SWRConfiguration} from 'swr'


// ErrorMessage is a data transfer object
export interface ErrorMessage {
code: number
item: string
}

// Code generated by RonyKIT Stub Generator (TypeScript); DO NOT EDIT.

import useSWR, { SWRConfiguration } from 'swr'

// KeyValue is a data transfer object
export interface KeyValue {
key: string
value: number
}

// ErrorMessage is a data transfer object
export interface ErrorMessage {
code: number
item: string
}
// KeyValue is a data transfer object
export interface KeyValue {
key: string
value: number
}
// SimpleHdr is a data transfer object
export interface SimpleHdr {
sKey1: string
sKey2: number
}
// VeryComplexRequest is a data transfer object
export interface VeryComplexRequest extends SimpleHdr {
key1: string
key1Ptr?: string
mapKey1: {[key: string]: number}
mapKey2: {[key: number]: KeyValue}
sliceKey1: boolean[]
sliceKey2: KeyValue[]
rawKey: any
}
// VeryComplexResponse is a data transfer object
export interface VeryComplexResponse {
key1: string
key1Ptr?: string
mapKey1: {[key: string]: number}
mapKey2: {[key: number]: KeyValue}
sliceKey1: number[]
sliceKey2: KeyValue[]
}
// SimpleHdr is a data transfer object
export interface SimpleHdr {
sKey1: string
sKey2: number
}

// VeryComplexRequest is a data transfer object
export interface VeryComplexRequest extends SimpleHdr {
key1: string
key1Ptr?: string
mapKey1: { [key: string]: number }
mapKey2: { [key: number]: KeyValue }
sliceKey1: boolean[]
sliceKey2: KeyValue[]
rawKey: any
}

// VeryComplexResponse is a data transfer object
export interface VeryComplexResponse {
key1: string
key1Ptr?: string
mapKey1: { [key: string]: number }
mapKey2: { [key: number]: KeyValue }
sliceKey1: number[]
sliceKey2: KeyValue[]
}


export class sampleServiceStub {
readonly serverURL: string ;
readonly serverURL: string;

constructor(serverURL: string) {
this.serverURL = serverURL.replace(/\/$/, '');
}
constructor(serverURL: string) {
this.serverURL = serverURL.replace(/\/$/, '');
}


// @ts-ignore
async complexDummy(req: VeryComplexRequest, headers?: HeadersInit): Promise<VeryComplexResponse> {
return fetch(this.serverURL + `/complexDummy`, {
// @ts-ignore
async complexDummy(req: VeryComplexRequest, headers?: HeadersInit): Promise<VeryComplexResponse> {
return fetch(this.serverURL + `/complexDummy`, {
method: "POST",
headers: {
"Content-Type": "application/json",
...headers,
"Content-Type": "application/json",
...headers,
},
body: JSON.stringify(req)
}).then((res: Response) => {
}).then((res: Response) => {
if (res.status !== 200) {
throw new Error("Failed to fetch the data");
throw new Error("Failed to fetch the data");
}

return res.json()
})
}
// @ts-ignore
async complexDummy2(req: VeryComplexRequest, headers?: HeadersInit): Promise<VeryComplexResponse> {
return fetch(this.serverURL + `/complexDummy/${req.key1}`, {
})
}

// @ts-ignore
async complexDummy2(req: VeryComplexRequest, headers?: HeadersInit): Promise<VeryComplexResponse> {
return fetch(this.serverURL + `/complexDummy/${req.key1}`, {
method: "POST",
headers: {
"Content-Type": "application/json",
...headers,
"Content-Type": "application/json",
...headers,
},
body: JSON.stringify(req)
}).then((res: Response) => {
}).then((res: Response) => {
if (res.status !== 200) {
throw new Error("Failed to fetch the data");
throw new Error("Failed to fetch the data");
}

return res.json()
})
}
// @ts-ignore
async getComplexDummy(req: VeryComplexRequest, headers?: HeadersInit): Promise<VeryComplexResponse> {
const keys = Object.keys(req);
const keyValuePairs = keys.map(key => {
})
}

// @ts-ignore
async getComplexDummy(req: VeryComplexRequest, headers?: HeadersInit): Promise<VeryComplexResponse> {
const keys = Object.keys(req);
const keyValuePairs = keys.map(key => {
return encodeURIComponent(key) + '=' + encodeURIComponent((req as any)[key]);
}).join('&');
const queryParams = (keyValuePairs.length > 0) ? `?${keyValuePairs}`: ""
const url = `${this.serverURL}/complexDummy/${req.key1}/xs/${req.sKey1}${queryParams}`;
return fetch(url, {
}).join('&');
const queryParams = (keyValuePairs.length > 0) ? `?${keyValuePairs}` : ""
const url = `${this.serverURL}/complexDummy/${req.key1}/xs/${req.sKey1}${queryParams}`;
return fetch(url, {
method: "GET",
headers: {
"Content-Type": "application/json",
...headers,
"Content-Type": "application/json",
...headers,
}
}).then((res: Response) => {
}).then((res: Response) => {
if (res.status !== 200) {
throw new Error("Failed to fetch the data");
throw new Error("Failed to fetch the data");
}

return res.json()
})
}
})
}

} // end of sampleServiceStub


export function useComplexDummy(
export function useComplexDummy(
stub: sampleServiceStub,
req: VeryComplexRequest,
reqHeader?: HeadersInit,
options?: Partial<SWRConfiguration<VeryComplexResponse>>
) {
) {
return useSWR(
[req, 'ComplexDummy'],
(req) => {
return stub.complexDummy(req[0], reqHeader)
},
options
[req, 'ComplexDummy'],
(req) => {
return stub.complexDummy(req[0], reqHeader)
},
options
)
}
export function useComplexDummy2(
}

export function useComplexDummy2(
stub: sampleServiceStub,
req: VeryComplexRequest,
reqHeader?: HeadersInit,
options?: Partial<SWRConfiguration<VeryComplexResponse>>
) {
) {
return useSWR(
[req, 'ComplexDummy2'],
(req) => {
return stub.complexDummy2(req[0], reqHeader)
},
options
[req, 'ComplexDummy2'],
(req) => {
return stub.complexDummy2(req[0], reqHeader)
},
options
)
}
export function useGetComplexDummy(
}

export function useGetComplexDummy(
stub: sampleServiceStub,
req: VeryComplexRequest,
reqHeader?: HeadersInit,
options?: Partial<SWRConfiguration<VeryComplexResponse>>
) {
) {
return useSWR(
[req, 'GetComplexDummy'],
(req) => {
return stub.getComplexDummy(req[0], reqHeader)
},
options
[req, 'GetComplexDummy'],
(req) => {
return stub.getComplexDummy(req[0], reqHeader)
},
options
)
}
}

0 comments on commit 4d888bf

Please sign in to comment.