MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / buildRequest

Function buildRequest

types/xxx_test.go:146–168  ·  view source on GitHub ↗
(qt QueryType, qs []Query)

Source from the content-addressed store, hash-verified

144}
145
146func buildRequest(qt QueryType, qs []Query) (r *Request) {
147 var (
148 id proto.NodeID
149 err error
150 )
151 if id, err = kms.GetLocalNodeID(); err != nil {
152 id = proto.NodeID("00000000000000000000000000000000")
153 }
154 r = &Request{
155 Header: SignedRequestHeader{
156 RequestHeader: RequestHeader{
157 NodeID: id,
158 Timestamp: time.Now().UTC(),
159 QueryType: qt,
160 },
161 },
162 Payload: RequestPayload{Queries: qs},
163 }
164 if err = r.Sign(testingPrivateKey); err != nil {
165 panic(err)
166 }
167 return
168}
169
170func buildResponse(header *SignedRequestHeader, cols []string, types []string, rows []ResponseRow) (r *Response) {
171 var (

Callers 1

BenchmarkTypesFunction · 0.70

Calls 3

GetLocalNodeIDFunction · 0.92
NodeIDTypeAlias · 0.92
SignMethod · 0.65

Tested by

no test coverage detected