cuelang.org/go@v0.13.0/pkg/tool/http/pkg.go (about) 1 // Code generated by cuelang.org/go/pkg/gen. DO NOT EDIT. 2 3 // Package http provides tasks related to the HTTP protocol. 4 // 5 // These are the supported tasks: 6 // 7 // Get: Do & {method: "GET"} 8 // Post: Do & {method: "POST"} 9 // Put: Do & {method: "PUT"} 10 // Delete: Do & {method: "DELETE"} 11 // 12 // Do: { 13 // $id: _id 14 // _id: *"tool/http.Do" | "http" // http for backwards compatibility 15 // 16 // method: string 17 // url: string // TODO: make url.URL type 18 // 19 // // followRedirects controls whether the http client follows redirects 20 // // or not. Defaults to true, like the default net/http client in Go. 21 // followRedirects: *true | bool 22 // 23 // tls: { 24 // // Whether the server certificate must be validated. 25 // verify: *true | bool 26 // // PEM encoded certificate(s) to validate the server certificate. 27 // // If not set the CA bundle of the system is used. 28 // caCert?: bytes | string 29 // } 30 // 31 // request: { 32 // body?: bytes | string 33 // header: [string]: string | [...string] 34 // trailer: [string]: string | [...string] 35 // } 36 // response: { 37 // status: string 38 // statusCode: int 39 // 40 // body: *bytes | string 41 // header: [string]: string | [...string] 42 // trailer: [string]: string | [...string] 43 // } 44 // } 45 // 46 // // TODO: support serving once we have the cue serve command. 47 // // Serve: { 48 // // port: int 49 // // 50 // // cert: string 51 // // key: string 52 // // 53 // // handle: [Pattern=string]: Message & { 54 // // pattern: Pattern 55 // // } 56 // // } 57 package http 58 59 import ( 60 "cuelang.org/go/internal/core/adt" 61 "cuelang.org/go/internal/pkg" 62 ) 63 64 func init() { 65 pkg.Register("tool/http", p) 66 } 67 68 var _ = adt.TopKind // in case the adt package isn't used 69 70 var p = &pkg.Package{ 71 Native: []*pkg.Builtin{}, 72 CUE: `{ 73 Get: Do & {method: "GET"} 74 Post: Do & {method: "POST"} 75 Put: Do & {method: "PUT"} 76 Delete: Do & {method: "DELETE"} 77 Do: { 78 $id: _id 79 _id: *"tool/http.Do" | "http" 80 method: string 81 url: string 82 followRedirects: *true | bool 83 tls: { 84 verify: *true | bool 85 caCert?: bytes | string 86 } 87 request: { 88 body?: bytes | string 89 header: [string]: string | [...string] 90 trailer: [string]: string | [...string] 91 } 92 response: { 93 status: string 94 statusCode: int 95 body: *bytes | string 96 header: [string]: string | [...string] 97 trailer: [string]: string | [...string] 98 } 99 } 100 }`, 101 }