// BatchGet returns an error if cfg.getError is set.
552484
func (t *InjectedTransaction) BatchGet(keys []Key) (map[string][]byte, error) {
	t.cfg.RLock()
	defer t.cfg.RUnlock()
	if t.cfg.getError != nil {
		return nil, t.cfg.getError
	}
	return t.Transaction.BatchGet(keys)
}
51694
func (ctx *BatchedContext) errors() error {
	if !ctx.checkResults() {
		return nil
	}
	err := make(errorSlice, len(ctx.results))
	for i, res := range ctx.results {
		err[i] = result(res)
	}
	return err
}
915196
func (c *Client) SimpleGet(target string) (*http.Response, error) {
	// We parse the URL and then convert it right back to a string
	// later; this just acts as a check that Fastly isn't sending
	// us nonsense.
	url, err := url.Parse(target)
	if err != nil {
		return nil, err
	}

	request, err := http.NewRequest("GET", url.String(), nil)
	if err != nil {
		return nil, err
	}

	if len(c.apiKey) > 0 {
		request.Header.Set(APIKeyHeader, c.apiKey)
	}
	request.Header.Set("User-Agent", UserAgent)

	resp, err := checkResp(c.HTTPClient.Do(request))
	if err != nil {
		return resp, err
	}
	return resp, nil
}
1362763
func HttpGet(client *http.Client, url string, header http.Header) (io.ReadCloser, error) {
	return HttpCall(client, "GET", url, header, nil)
}
56832
func (c *EzClient) JSONGet(url string, out interface{}) (int, error) {
	resp, err := c.Client.Get(url)
	if err != nil {
		return 0, err
	}
	return decodeJSONResponse(resp, out)
}
12325
func (gt *Getter) Get(ctx groupcache.Context, key string, dest groupcache.Sink) error {
	myctx, ok := ctx.(*Context)
	if !ok {
		return fmt.Errorf("invalid context type: %T", ctx)
	}
	if myctx == nil {
		return fmt.Errorf("context is nil")
	}
	if myctx.Params == nil {
		return fmt.Errorf("context has nil Params")
	}
	im, err := gt.Server.Get(myctx.Params)
	if err != nil {
		return err
	}
	data, err := im.MarshalBinary()
	if err != nil {
		return err
	}
	return dest.SetBytes(data)
}
896111
func HTTPGet(httpUrl string) ([]byte, error) {

	r, err := http.Get(httpUrl)

	if err != nil {
		return nil, err
	}

	defer r.Body.Close()

	if err != nil {
		return nil, err
	}

	// read the response and check
	body, err := ioutil.ReadAll(r.Body)
	if err != nil {
		return nil, err
	}

	return body, nil
}
418835
func (c *RawKVClient) BatchGet(keys [][]byte) ([][]byte, error) {
	start := time.Now()
	defer func() {
		tikvRawkvCmdHistogramWithBatchGet.Observe(time.Since(start).Seconds())
	}()

	bo := NewBackoffer(context.Background(), rawkvMaxBackoff)
	resp, err := c.sendBatchReq(bo, keys, tikvrpc.CmdRawBatchGet)
	if err != nil {
		return nil, errors.Trace(err)
	}

	cmdResp := resp.RawBatchGet
	if cmdResp == nil {
		return nil, errors.Trace(ErrBodyMissing)
	}

	keyToValue := make(map[string][]byte, len(keys))
	for _, pair := range cmdResp.Pairs {
		keyToValue[string(pair.Key)] = pair.Value
	}

	values := make([][]byte, len(keys))
	for i, key := range keys {
		values[i] = keyToValue[string(key)]
	}
	return values, nil
}
1201967
func (cfs *cacheFSObjects) Get(ctx context.Context, bucket, object string, startOffset int64, length int64, writer io.Writer, etag string, opts ObjectOptions) (err error) {
	return cfs.GetObject(ctx, bucket, object, startOffset, length, writer, etag, opts)
}
705338
func (c *Cache) MustGet(key Key) interface{} {
	value, err := c.Get(key)
	if err != nil {
		panic(fmt.Sprintf("error returned from Get: %s", err))
	}
	return value
}
12080
func QueryGet(request *http.Request, key string) string {
	return request.URL.Query().Get(key)
}
912073
func (h Handler) Get(cmd common.GetRequest) (<-chan common.GetResponse, <-chan error) {
	// No buffering here so there's not multiple gets in memory
	dataOut := make(chan common.GetResponse)
	errorOut := make(chan error)
	go realHandleGet(cmd, dataOut, errorOut, h.rw)
	return dataOut, errorOut
}
1263832
func (s *MerkleStoreImpl) dbGet(m libkb.MetaContext, hash keybase1.MerkleStoreKitHash) *keybase1.MerkleStoreKit {
	db := m.G().LocalDb
	if db == nil {
		return nil
	}
	var entry dbKit
	if found, err := db.GetInto(&entry, s.dbKey()); err != nil {
		m.Debug("MerkleStore: error reading from db: %s", err)
		return nil
	} else if !found {
		return nil
	}
	if entry.DBVersion != dbVersion {
		return nil
	}
	if entry.Hash == hash {
		return &entry.Kit
	}
	return nil
}
110394
func (c *Collection) get(ctx context.Context, traceCtx opentracing.SpanContext, key string, opts *GetOptions) (docOut *GetResult, errOut error) {
	span := c.startKvOpTrace(traceCtx, "get")
	defer span.Finish()

	agent, err := c.getKvProvider()
	if err != nil {
		return nil, err
	}

	ctrl := c.newOpManager(ctx)
	err = ctrl.wait(agent.GetEx(gocbcore.GetOptions{
		Key:            []byte(key),
		TraceContext:   traceCtx,
		CollectionName: c.name(),
		ScopeName:      c.scopeName(),
	}, func(res *gocbcore.GetResult, err error) {
		if err != nil {
			errOut = maybeEnhanceErr(err, key)
			ctrl.resolve()
			return
		}
		if res != nil {
			doc := &GetResult{
				Result: Result{
					cas: Cas(res.Cas),
				},
				contents: res.Value,
				flags:    res.Flags,
			}

			docOut = doc
		}

		ctrl.resolve()
	}))
	if err != nil {
		errOut = err
	}

	return
}
146416
func (db *DB) MultiGet(opts *ReadOptions, keys ...[]byte) (Slices, error) {
	cKeys, cKeySizes := byteSlicesToCSlices(keys)
	defer cKeys.Destroy()
	vals := make(charsSlice, len(keys))
	valSizes := make(sizeTSlice, len(keys))
	rocksErrs := make(charsSlice, len(keys))

	C.rocksdb_multi_get(
		db.c,
		opts.c,
		C.size_t(len(keys)),
		cKeys.c(),
		cKeySizes.c(),
		vals.c(),
		valSizes.c(),
		rocksErrs.c(),
	)

	var errs []error

	for i, rocksErr := range rocksErrs {
		if rocksErr != nil {
			defer C.free(unsafe.Pointer(rocksErr))
			err := fmt.Errorf("getting %q failed: %v", string(keys[i]), C.GoString(rocksErr))
			errs = append(errs, err)
		}
	}

	if len(errs) > 0 {
		return nil, fmt.Errorf("failed to get %d keys, first error: %v", len(errs), errs[0])
	}

	slices := make(Slices, len(keys))
	for i, val := range vals {
		slices[i] = NewSlice(val, valSizes[i])
	}

	return slices, nil
}
850350
func Batch() func(*Options) error {
	return func(opts *Options) error {
		opts.batchMode = true
		return nil
	}
}
1257708
func Get(key string, args ...interface{}) data.Value {
	return defaultCacher().Get(key, args...)
}