| 1 | package rethinkdbscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/ |
| 2 | |
| 3 | import ( |
| 4 | "encoding/base64scip-go gomod github.com/golang/go/src go1.14 `encoding/base64`/" |
| 5 | "encoding/jsonscip-go gomod github.com/golang/go/src go1.14 `encoding/json`/" |
| 6 | |
| 7 | "reflectscip-go gomod github.com/golang/go/src go1.14 reflect/" |
| 8 | |
| 9 | pscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/ "gopkg.in/rethinkdb/rethinkdb-go.v6/ql2scip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/" |
| 10 | ) |
| 11 | |
| 12 | // Expr converts any value to an expression and is also used by many other terms |
| 13 | // such as Insert and Update. This function can convert the following basic Go |
| 14 | // types (bool, int, uint, string, float) and even pointers, maps and structs. |
| 15 | // |
| 16 | // When evaluating structs they are encoded into a map before being sent to the |
| 17 | // server. Each exported field is added to the map unless |
| 18 | // |
| 19 | // - the field's tag is "-", or |
| 20 | // - the field is empty and its tag specifies the "omitempty" option. |
| 21 | // |
| 22 | // Each fields default name in the map is the field name but can be specified |
| 23 | // in the struct field's tag value. The "rethinkdb" key in the struct field's |
| 24 | // tag value is the key name, followed by an optional comma and options. Examples: |
| 25 | // |
| 26 | // // Field is ignored by this package. |
| 27 | // Field int `rethinkdb:"-"` |
| 28 | // // Field appears as key "myName". |
| 29 | // Field int `rethinkdb:"myName"` |
| 30 | // // Field appears as key "myName" and |
| 31 | // // the field is omitted from the object if its value is empty, |
| 32 | // // as defined above. |
| 33 | // Field int `rethinkdb:"myName,omitempty"` |
| 34 | // // Field appears as key "Field" (the default), but |
| 35 | // // the field is skipped if empty. |
| 36 | // // Note the leading comma. |
| 37 | // Field int `rethinkdb:",omitempty"` |
| 38 | func Exprscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Expr().(val interface{}) Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term# { |
| 39 | if val == nil { |
| 40 | return Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#{ |
| 41 | termTypescip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#termType.: pscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/.Term_DATUMscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/Term_DATUM., |
| 42 | datascip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#data.: nil, |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | switch val := val.(type) { |
| 47 | case Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#: |
| 48 | return val |
| 49 | case []interface{}: |
| 50 | vals := make([]Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#, len(val)) |
| 51 | for i, v := range val { |
| 52 | vals[i] = Exprscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Expr().(v) |
| 53 | } |
| 54 | |
| 55 | return makeArrayscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/makeArray().(vals) |
| 56 | case map[string]interface{}: |
| 57 | vals := make(map[string]Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#, len(val)) |
| 58 | for k, v := range val { |
| 59 | vals[k] = Exprscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Expr().(v) |
| 60 | } |
| 61 | |
| 62 | return makeObjectscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/makeObject().(vals) |
| 63 | case |
| 64 | bool, |
| 65 | int, |
| 66 | int8, |
| 67 | int16, |
| 68 | int32, |
| 69 | int64, |
| 70 | uint, |
| 71 | uint8, |
| 72 | uint16, |
| 73 | uint32, |
| 74 | uint64, |
| 75 | float32, |
| 76 | float64, |
| 77 | uintptr, |
| 78 | string, |
| 79 | *bool, |
| 80 | *int, |
| 81 | *int8, |
| 82 | *int16, |
| 83 | *int32, |
| 84 | *int64, |
| 85 | *uint, |
| 86 | *uint8, |
| 87 | *uint16, |
| 88 | *uint32, |
| 89 | *uint64, |
| 90 | *float32, |
| 91 | *float64, |
| 92 | *uintptr, |
| 93 | *string: |
| 94 | return Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#{ |
| 95 | termTypescip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#termType.: pscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/.Term_DATUMscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/Term_DATUM., |
| 96 | datascip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#data.: val, |
| 97 | } |
| 98 | default: |
| 99 | // Use reflection to check for other types |
| 100 | valType := reflectscip-go gomod github.com/golang/go/src go1.14 reflect/.TypeOfscip-go gomod github.com/golang/go/src go1.14 reflect/TypeOf().(val) |
| 101 | valValue := reflectscip-go gomod github.com/golang/go/src go1.14 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.14 reflect/ValueOf().(val) |
| 102 | |
| 103 | switch valType.Kindscip-go gomod github.com/golang/go/src go1.14 reflect/Type#Kind().() { |
| 104 | case reflectscip-go gomod github.com/golang/go/src go1.14 reflect/.Funcscip-go gomod github.com/golang/go/src go1.14 reflect/Func.: |
| 105 | return makeFuncscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/makeFunc().(val) |
| 106 | case reflectscip-go gomod github.com/golang/go/src go1.14 reflect/.Structscip-go gomod github.com/golang/go/src go1.14 reflect/Struct., reflectscip-go gomod github.com/golang/go/src go1.14 reflect/.Mapscip-go gomod github.com/golang/go/src go1.14 reflect/Map., reflectscip-go gomod github.com/golang/go/src go1.14 reflect/.Ptrscip-go gomod github.com/golang/go/src go1.14 reflect/Ptr.: |
| 107 | data, err := encodescip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/encode().(val) |
| 108 | |
| 109 | if err != nil || data == nil { |
| 110 | return Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#{ |
| 111 | termTypescip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#termType.: pscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/.Term_DATUMscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/Term_DATUM., |
| 112 | datascip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#data.: nil, |
| 113 | lastErrscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#lastErr.: err, |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | return Exprscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Expr().(data) |
| 118 | |
| 119 | case reflectscip-go gomod github.com/golang/go/src go1.14 reflect/.Slicescip-go gomod github.com/golang/go/src go1.14 reflect/Slice., reflectscip-go gomod github.com/golang/go/src go1.14 reflect/.Arrayscip-go gomod github.com/golang/go/src go1.14 reflect/Array.: |
| 120 | // Check if slice is a byte slice |
| 121 | if valType.Elemscip-go gomod github.com/golang/go/src go1.14 reflect/Type#Elem().().Kindscip-go gomod github.com/golang/go/src go1.14 reflect/Type#Kind().() == reflectscip-go gomod github.com/golang/go/src go1.14 reflect/.Uint8scip-go gomod github.com/golang/go/src go1.14 reflect/Uint8. { |
| 122 | data, err := encodescip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/encode().(val) |
| 123 | |
| 124 | if err != nil || data == nil { |
| 125 | return Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#{ |
| 126 | termTypescip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#termType.: pscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/.Term_DATUMscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/Term_DATUM., |
| 127 | datascip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#data.: nil, |
| 128 | lastErrscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#lastErr.: err, |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | return Exprscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Expr().(data) |
| 133 | } |
| 134 | |
| 135 | vals := make([]Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#, valValue.Lenscip-go gomod github.com/golang/go/src go1.14 reflect/Value#Len().()) |
| 136 | for i := 0; i < valValue.Lenscip-go gomod github.com/golang/go/src go1.14 reflect/Value#Len().(); i++ { |
| 137 | vals[i] = Exprscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Expr().(valValue.Indexscip-go gomod github.com/golang/go/src go1.14 reflect/Value#Index().(i).Interfacescip-go gomod github.com/golang/go/src go1.14 reflect/Value#Interface().()) |
| 138 | } |
| 139 | |
| 140 | return makeArrayscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/makeArray().(vals) |
| 141 | default: |
| 142 | data, err := encodescip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/encode().(val) |
| 143 | |
| 144 | if err != nil || data == nil { |
| 145 | return Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#{ |
| 146 | termTypescip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#termType.: pscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/.Term_DATUMscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/Term_DATUM., |
| 147 | datascip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#data.: nil, |
| 148 | lastErrscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#lastErr.: err, |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | return Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#{ |
| 153 | termTypescip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#termType.: pscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/.Term_DATUMscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/Term_DATUM., |
| 154 | datascip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#data.: data, |
| 155 | } |
| 156 | } |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | // JSOpts contains the optional arguments for the JS term |
| 161 | type JSOptsscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/JSOpts# struct { |
| 162 | Timeoutscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/JSOpts#Timeout. interface{} `rethinkdb:"timeout,omitempty"` |
| 163 | } |
| 164 | |
| 165 | func (o JSOptsscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/JSOpts#) toMapscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/JSOpts#toMap().() map[string]interface{} { |
| 166 | return optArgsToMapscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/optArgsToMap().(o) |
| 167 | } |
| 168 | |
| 169 | // JS creates a JavaScript expression which is evaluated by the database when |
| 170 | // running the query. |
| 171 | func JSscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/JS().(jssrc interface{}, optArgs ...JSOptsscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/JSOpts#) Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term# { |
| 172 | opts := map[string]interface{}{} |
| 173 | if len(optArgs) >= 1 { |
| 174 | opts = optArgs[0].toMapscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/JSOpts#toMap().() |
| 175 | } |
| 176 | return constructRootTermscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/constructRootTerm().("Js", pscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/.Term_JAVASCRIPTscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/Term_JAVASCRIPT., []interface{}{jssrc}, opts) |
| 177 | } |
| 178 | |
| 179 | // HTTPOpts contains the optional arguments for the HTTP term |
| 180 | type HTTPOptsscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/HTTPOpts# struct { |
| 181 | // General Options |
| 182 | Timeoutscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/HTTPOpts#Timeout. interface{} `rethinkdb:"timeout,omitempty"` |
| 183 | Reattemptsscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/HTTPOpts#Reattempts. interface{} `rethinkdb:"reattempts,omitempty"` |
| 184 | Redirectsscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/HTTPOpts#Redirects. interface{} `rethinkdb:"redirect,omitempty"` |
| 185 | Verifyscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/HTTPOpts#Verify. interface{} `rethinkdb:"verify,omitempty"` |
| 186 | ResultFormatscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/HTTPOpts#ResultFormat. interface{} `rethinkdb:"result_format,omitempty"` |
| 187 | |
| 188 | // Request Options |
| 189 | Methodscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/HTTPOpts#Method. interface{} `rethinkdb:"method,omitempty"` |
| 190 | Authscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/HTTPOpts#Auth. interface{} `rethinkdb:"auth,omitempty"` |
| 191 | Paramsscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/HTTPOpts#Params. interface{} `rethinkdb:"params,omitempty"` |
| 192 | Headerscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/HTTPOpts#Header. interface{} `rethinkdb:"header,omitempty"` |
| 193 | Datascip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/HTTPOpts#Data. interface{} `rethinkdb:"data,omitempty"` |
| 194 | |
| 195 | // Pagination |
| 196 | Pagescip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/HTTPOpts#Page. interface{} `rethinkdb:"page,omitempty"` |
| 197 | PageLimitscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/HTTPOpts#PageLimit. interface{} `rethinkdb:"page_limit,omitempty"` |
| 198 | } |
| 199 | |
| 200 | func (o HTTPOptsscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/HTTPOpts#) toMapscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/HTTPOpts#toMap().() map[string]interface{} { |
| 201 | return optArgsToMapscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/optArgsToMap().(o) |
| 202 | } |
| 203 | |
| 204 | // HTTP retrieves data from the specified URL over HTTP. The return type depends |
| 205 | // on the resultFormat option, which checks the Content-Type of the response by |
| 206 | // default. |
| 207 | func HTTPscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/HTTP().(url interface{}, optArgs ...HTTPOptsscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/HTTPOpts#) Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term# { |
| 208 | opts := map[string]interface{}{} |
| 209 | if len(optArgs) >= 1 { |
| 210 | opts = optArgs[0].toMapscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/HTTPOpts#toMap().() |
| 211 | } |
| 212 | return constructRootTermscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/constructRootTerm().("Http", pscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/.Term_HTTPscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/Term_HTTP., []interface{}{url}, opts) |
| 213 | } |
| 214 | |
| 215 | // JSON parses a JSON string on the server. |
| 216 | func JSONscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/JSON().(args ...interface{}) Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term# { |
| 217 | return constructRootTermscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/constructRootTerm().("Json", pscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/.Term_JSONscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/Term_JSON., args, map[string]interface{}{}) |
| 218 | } |
| 219 | |
| 220 | // Error throws a runtime error. If called with no arguments inside the second argument |
| 221 | // to `default`, re-throw the current error. |
| 222 | func Errorscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Error().(args ...interface{}) Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term# { |
| 223 | return constructRootTermscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/constructRootTerm().("Error", pscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/.Term_ERRORscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/Term_ERROR., args, map[string]interface{}{}) |
| 224 | } |
| 225 | |
| 226 | // Args is a special term used to splice an array of arguments into another term. |
| 227 | // This is useful when you want to call a variadic term such as GetAll with a set |
| 228 | // of arguments provided at runtime. |
| 229 | func Argsscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Args().(args ...interface{}) Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term# { |
| 230 | return constructRootTermscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/constructRootTerm().("Args", pscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/.Term_ARGSscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/Term_ARGS., args, map[string]interface{}{}) |
| 231 | } |
| 232 | |
| 233 | // Binary encapsulates binary data within a query. |
| 234 | // |
| 235 | // The type of data binary accepts depends on the client language. In Go, it |
| 236 | // expects either a byte array/slice or a bytes.Buffer. |
| 237 | // |
| 238 | // Only a limited subset of ReQL commands may be chained after binary: |
| 239 | // - coerceTo can coerce binary objects to string types |
| 240 | // - count will return the number of bytes in the object |
| 241 | // - slice will treat bytes like array indexes (i.e., slice(10,20) will return bytes 10–19) |
| 242 | // - typeOf returns PTYPE<BINARY> |
| 243 | // - info will return information on a binary object. |
| 244 | func Binaryscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Binary().(data interface{}) Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term# { |
| 245 | var b []byte |
| 246 | |
| 247 | switch data := data.(type) { |
| 248 | case Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#: |
| 249 | return constructRootTermscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/constructRootTerm().("Binary", pscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/.Term_BINARYscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/Term_BINARY., []interface{}{data}, map[string]interface{}{}) |
| 250 | case []byte: |
| 251 | b = data |
| 252 | default: |
| 253 | typ := reflectscip-go gomod github.com/golang/go/src go1.14 reflect/.TypeOfscip-go gomod github.com/golang/go/src go1.14 reflect/TypeOf().(data) |
| 254 | if typ.Kindscip-go gomod github.com/golang/go/src go1.14 reflect/Type#Kind().() == reflectscip-go gomod github.com/golang/go/src go1.14 reflect/.Slicescip-go gomod github.com/golang/go/src go1.14 reflect/Slice. && typ.Elemscip-go gomod github.com/golang/go/src go1.14 reflect/Type#Elem().().Kindscip-go gomod github.com/golang/go/src go1.14 reflect/Type#Kind().() == reflectscip-go gomod github.com/golang/go/src go1.14 reflect/.Uint8scip-go gomod github.com/golang/go/src go1.14 reflect/Uint8. { |
| 255 | return Binaryscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Binary().(reflectscip-go gomod github.com/golang/go/src go1.14 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.14 reflect/ValueOf().(data).Bytesscip-go gomod github.com/golang/go/src go1.14 reflect/Value#Bytes().()) |
| 256 | } else if typ.Kindscip-go gomod github.com/golang/go/src go1.14 reflect/Type#Kind().() == reflectscip-go gomod github.com/golang/go/src go1.14 reflect/.Arrayscip-go gomod github.com/golang/go/src go1.14 reflect/Array. && typ.Elemscip-go gomod github.com/golang/go/src go1.14 reflect/Type#Elem().().Kindscip-go gomod github.com/golang/go/src go1.14 reflect/Type#Kind().() == reflectscip-go gomod github.com/golang/go/src go1.14 reflect/.Uint8scip-go gomod github.com/golang/go/src go1.14 reflect/Uint8. { |
| 257 | v := reflectscip-go gomod github.com/golang/go/src go1.14 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.14 reflect/ValueOf().(data) |
| 258 | b = make([]byte, v.Lenscip-go gomod github.com/golang/go/src go1.14 reflect/Value#Len().()) |
| 259 | for i := 0; i < v.Lenscip-go gomod github.com/golang/go/src go1.14 reflect/Value#Len().(); i++ { |
| 260 | b[i] = v.Indexscip-go gomod github.com/golang/go/src go1.14 reflect/Value#Index().(i).Interfacescip-go gomod github.com/golang/go/src go1.14 reflect/Value#Interface().().(byte) |
| 261 | } |
| 262 | return Binaryscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Binary().(b) |
| 263 | } |
| 264 | panic("Unsupported binary type") |
| 265 | } |
| 266 | |
| 267 | return binaryTermscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/binaryTerm().(base64scip-go gomod github.com/golang/go/src go1.14 `encoding/base64`/.StdEncodingscip-go gomod github.com/golang/go/src go1.14 `encoding/base64`/StdEncoding..EncodeToStringscip-go gomod github.com/golang/go/src go1.14 `encoding/base64`/Encoding#EncodeToString().(b)) |
| 268 | } |
| 269 | |
| 270 | func binaryTermscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/binaryTerm().(data string) Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term# { |
| 271 | t := constructRootTermscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/constructRootTerm().("Binary", pscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/.Term_BINARYscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/Term_BINARY., []interface{}{}, map[string]interface{}{}) |
| 272 | t.datascip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#data. = data |
| 273 | |
| 274 | return t |
| 275 | } |
| 276 | |
| 277 | // Do evaluates the expr in the context of one or more value bindings. The type of |
| 278 | // the result is the type of the value returned from expr. |
| 279 | func (t Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#) Doscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#Do().(args ...interface{}) Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term# { |
| 280 | newArgs := []interface{}{} |
| 281 | newArgs = append(newArgs, funcWrapscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/funcWrap().(args[len(args)-1])) |
| 282 | newArgs = append(newArgs, t) |
| 283 | newArgs = append(newArgs, args[:len(args)-1]...) |
| 284 | |
| 285 | return constructRootTermscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/constructRootTerm().("Do", pscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/.Term_FUNCALLscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/Term_FUNCALL., newArgs, map[string]interface{}{}) |
| 286 | } |
| 287 | |
| 288 | // Do evaluates the expr in the context of one or more value bindings. The type of |
| 289 | // the result is the type of the value returned from expr. |
| 290 | func Doscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Do().(args ...interface{}) Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term# { |
| 291 | newArgs := []interface{}{} |
| 292 | newArgs = append(newArgs, funcWrapscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/funcWrap().(args[len(args)-1])) |
| 293 | newArgs = append(newArgs, args[:len(args)-1]...) |
| 294 | |
| 295 | return constructRootTermscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/constructRootTerm().("Do", pscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/.Term_FUNCALLscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/Term_FUNCALL., newArgs, map[string]interface{}{}) |
| 296 | } |
| 297 | |
| 298 | // Branch evaluates one of two control paths based on the value of an expression. |
| 299 | // branch is effectively an if renamed due to language constraints. |
| 300 | // |
| 301 | // The type of the result is determined by the type of the branch that gets executed. |
| 302 | func Branchscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Branch().(args ...interface{}) Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term# { |
| 303 | return constructRootTermscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/constructRootTerm().("Branch", pscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/.Term_BRANCHscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/Term_BRANCH., args, map[string]interface{}{}) |
| 304 | } |
| 305 | |
| 306 | // Branch evaluates one of two control paths based on the value of an expression. |
| 307 | // branch is effectively an if renamed due to language constraints. |
| 308 | // |
| 309 | // The type of the result is determined by the type of the branch that gets executed. |
| 310 | func (t Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#) Branchscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#Branch().(args ...interface{}) Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term# { |
| 311 | return constructMethodTermscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/constructMethodTerm().(t, "Branch", pscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/.Term_BRANCHscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/Term_BRANCH., args, map[string]interface{}{}) |
| 312 | } |
| 313 | |
| 314 | // ForEach loops over a sequence, evaluating the given write query for each element. |
| 315 | // |
| 316 | // It takes one argument of type `func (r.Term) interface{}`, for |
| 317 | // example clones a table: |
| 318 | // |
| 319 | // r.Table("table").ForEach(func (row r.Term) interface{} { |
| 320 | // return r.Table("new_table").Insert(row) |
| 321 | // }) |
| 322 | func (t Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#) ForEachscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#ForEach().(args ...interface{}) Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term# { |
| 323 | return constructMethodTermscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/constructMethodTerm().(t, "Foreach", pscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/.Term_FOR_EACHscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/Term_FOR_EACH., funcWrapArgsscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/funcWrapArgs().(args), map[string]interface{}{}) |
| 324 | } |
| 325 | |
| 326 | // Range generates a stream of sequential integers in a specified range. It |
| 327 | // accepts 0, 1, or 2 arguments, all of which should be numbers. |
| 328 | func Rangescip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Range().(args ...interface{}) Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term# { |
| 329 | return constructRootTermscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/constructRootTerm().("Range", pscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/.Term_RANGEscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/Term_RANGE., args, map[string]interface{}{}) |
| 330 | } |
| 331 | |
| 332 | // Default handles non-existence errors. Tries to evaluate and return its first argument. |
| 333 | // If an error related to the absence of a value is thrown in the process, or if |
| 334 | // its first argument returns null, returns its second argument. (Alternatively, |
| 335 | // the second argument may be a function which will be called with either the |
| 336 | // text of the non-existence error or null.) |
| 337 | func (t Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#) Defaultscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#Default().(args ...interface{}) Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term# { |
| 338 | return constructMethodTermscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/constructMethodTerm().(t, "Default", pscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/.Term_DEFAULTscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/Term_DEFAULT., args, map[string]interface{}{}) |
| 339 | } |
| 340 | |
| 341 | // CoerceTo converts a value of one type into another. |
| 342 | // |
| 343 | // You can convert: a selection, sequence, or object into an ARRAY, an array of |
| 344 | // pairs into an OBJECT, and any DATUM into a STRING. |
| 345 | func (t Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#) CoerceToscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#CoerceTo().(args ...interface{}) Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term# { |
| 346 | return constructMethodTermscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/constructMethodTerm().(t, "CoerceTo", pscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/.Term_COERCE_TOscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/Term_COERCE_TO., args, map[string]interface{}{}) |
| 347 | } |
| 348 | |
| 349 | // TypeOf gets the type of a value. |
| 350 | func TypeOfscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/TypeOf().(args ...interface{}) Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term# { |
| 351 | return constructRootTermscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/constructRootTerm().("TypeOf", pscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/.Term_TYPE_OFscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/Term_TYPE_OF., args, map[string]interface{}{}) |
| 352 | } |
| 353 | |
| 354 | // TypeOf gets the type of a value. |
| 355 | func (t Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#) TypeOfscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#TypeOf().(args ...interface{}) Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term# { |
| 356 | return constructMethodTermscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/constructMethodTerm().(t, "TypeOf", pscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/.Term_TYPE_OFscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/Term_TYPE_OF., args, map[string]interface{}{}) |
| 357 | } |
| 358 | |
| 359 | // ToJSON converts a ReQL value or object to a JSON string. |
| 360 | func (t Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#) ToJSONscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#ToJSON().() Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term# { |
| 361 | return constructMethodTermscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/constructMethodTerm().(t, "ToJSON", pscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/.Term_TO_JSON_STRINGscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/Term_TO_JSON_STRING., []interface{}{}, map[string]interface{}{}) |
| 362 | } |
| 363 | |
| 364 | // Info gets information about a RQL value. |
| 365 | func (t Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#) Infoscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#Info().(args ...interface{}) Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term# { |
| 366 | return constructMethodTermscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/constructMethodTerm().(t, "Info", pscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/.Term_INFOscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/Term_INFO., args, map[string]interface{}{}) |
| 367 | } |
| 368 | |
| 369 | // UUID returns a UUID (universally unique identifier), a string that can be used |
| 370 | // as a unique ID. If a string is passed to uuid as an argument, the UUID will be |
| 371 | // deterministic, derived from the string’s SHA-1 hash. |
| 372 | func UUIDscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/UUID().(args ...interface{}) Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term# { |
| 373 | return constructRootTermscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/constructRootTerm().("UUID", pscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/.Term_UUIDscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/Term_UUID., args, map[string]interface{}{}) |
| 374 | } |
| 375 | |
| 376 | // RawQuery creates a new query from a JSON string, this bypasses any encoding |
| 377 | // done by RethinkDB-go. The query should not contain the query type or any options |
| 378 | // as this should be handled using the normal driver API. |
| 379 | // |
| 380 | // THis query will only work if this is the only term in the query. |
| 381 | func RawQueryscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/RawQuery().(q []byte) Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term# { |
| 382 | data := jsonscip-go gomod github.com/golang/go/src go1.14 `encoding/json`/.RawMessagescip-go gomod github.com/golang/go/src go1.14 `encoding/json`/RawMessage#(q) |
| 383 | return Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#{ |
| 384 | namescip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#name.: "RawQuery", |
| 385 | rootTermscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#rootTerm.: true, |
| 386 | rawQueryscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#rawQuery.: true, |
| 387 | datascip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#data.: &data, |
| 388 | argsscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#args.: []Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#{ |
| 389 | Termscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#{ |
| 390 | termTypescip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#termType.: pscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/.Term_DATUMscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6/ql2`/Term_DATUM., |
| 391 | datascip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Term#data.: string(q), |
| 392 | }, |
| 393 | }, |
| 394 | } |
| 395 | } |