ClientFiles returns the generated HTTP client files.
(genpkg string, data *ServicesData)
| 11 | |
| 12 | // ClientFiles returns the generated HTTP client files. |
| 13 | func ClientFiles(genpkg string, data *ServicesData) []*codegen.File { |
| 14 | files := make([]*codegen.File, 0, len(data.Expressions.Services)*3) // preallocate for client files |
| 15 | for _, svc := range data.Expressions.Services { |
| 16 | files = append(files, clientFile(genpkg, svc, data)) |
| 17 | if f := WebsocketClientFile(genpkg, svc, data); f != nil { |
| 18 | files = append(files, f) |
| 19 | } |
| 20 | if f := sseClientFile(genpkg, svc, data); f != nil { |
| 21 | files = append(files, f) |
| 22 | } |
| 23 | } |
| 24 | for _, svc := range data.Expressions.Services { |
| 25 | if f := ClientEncodeDecodeFile(genpkg, svc, data); f != nil { |
| 26 | files = append(files, f) |
| 27 | } |
| 28 | } |
| 29 | return files |
| 30 | } |
| 31 | |
| 32 | // ClientEncodeDecodeFile returns the file containing the HTTP client encoding |
| 33 | // and decoding logic. |