Sign the request.
(signer *asymmetric.PrivateKey)
| 138 | |
| 139 | // Sign the request. |
| 140 | func (r *Request) Sign(signer *asymmetric.PrivateKey) (err error) { |
| 141 | // set query count |
| 142 | r.Header.BatchCount = uint64(len(r.Payload.Queries)) |
| 143 | |
| 144 | // compute payload hash |
| 145 | if err = buildHash(&r.Payload, &r.Header.QueriesHash); err != nil { |
| 146 | return |
| 147 | } |
| 148 | |
| 149 | return r.Header.Sign(signer) |
| 150 | } |
| 151 | |
| 152 | // SetMarshalCache sets _marshalCache. |
| 153 | func (r *Request) SetMarshalCache(buf []byte) { |