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

Method Query

sqlchain/chain.go:1025–1034  ·  view source on GitHub ↗

Query queries req from local chain state and returns the query results in resp.

(
	req *types.Request, isLeader bool)

Source from the content-addressed store, hash-verified

1023
1024// Query queries req from local chain state and returns the query results in resp.
1025func (c *Chain) Query(
1026 req *types.Request, isLeader bool) (tracker *x.QueryTracker, resp *types.Response, err error,
1027) {
1028 // TODO(leventeliu): we're using an external context passed by request. Make sure that
1029 // cancelling will be propagated to this context before chain instance stops.
1030 // update metrics
1031 c.expVars.Get(mwMinerChainRequestsCount).(mw.Metric).Add(1)
1032
1033 return c.st.QueryWithContext(req.GetContext(), req, isLeader)
1034}
1035
1036// AddResponse addes a response to the ackIndex, awaiting for acknowledgement.
1037func (c *Chain) AddResponse(resp *types.SignedResponseHeader) (err error) {

Callers

nothing calls this directly

Calls 4

QueryWithContextMethod · 0.80
GetMethod · 0.65
GetContextMethod · 0.65
AddMethod · 0.45

Tested by

no test coverage detected