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: *"tool/http.Do" | "http" // http for backwards compatibility 14 // 15 // method: string 16 // url: string // TODO: make url.URL type 17 // 18 // tls: { 19 // // Whether the server certificate must be validated. 20 // verify: *true | bool 21 // // PEM encoded certificate(s) to validate the server certificate. 22 // // If not set the CA bundle of the system is used. 23 // caCert?: bytes | string 24 // } 25 // 26 // request: { 27 // body?: bytes | string 28 // header: [string]: string | [...string] 29 // trailer: [string]: string | [...string] 30 // } 31 // response: { 32 // status: string 33 // statusCode: int 34 // 35 // body: *bytes | string 36 // header: [string]: string | [...string] 37 // trailer: [string]: string | [...string] 38 // } 39 // } 40 // 41 // // TODO: support serving once we have the cue serve command. 42 // // Serve: { 43 // // port: int 44 // // 45 // // cert: string 46 // // key: string 47 // // 48 // // handle: [Pattern=string]: Message & { 49 // // pattern: Pattern 50 // // } 51 // // } 52 package http 53 54 import ( 55 "cuelang.org/go/internal/core/adt" 56 "cuelang.org/go/internal/pkg" 57 ) 58 59 func init() { 60 pkg.Register("tool/http", p) 61 } 62 63 var _ = adt.TopKind // in case the adt package isn't used 64 65 var p = &pkg.Package{ 66 Native: []*pkg.Builtin{}, 67 CUE: `{ 68 Get: Do & { 69 method: "GET" 70 } 71 Post: Do & { 72 method: "POST" 73 } 74 Put: Do & { 75 method: "PUT" 76 } 77 Delete: Do & { 78 method: "DELETE" 79 } 80 Do: { 81 $id: *"tool/http.Do" | "http" 82 method: string 83 url: string 84 tls: { 85 verify: *true | bool 86 caCert?: bytes | string 87 } 88 request: { 89 body?: bytes | string 90 header: { 91 [string]: string | [...string] 92 } 93 trailer: { 94 [string]: string | [...string] 95 } 96 } 97 response: { 98 status: string 99 statusCode: int 100 body: *bytes | string 101 header: { 102 [string]: string | [...string] 103 } 104 trailer: { 105 [string]: string | [...string] 106 } 107 } 108 } 109 }`, 110 } 111