// Get returns the value of a given metric or rate.
// If the value does not exists error is non-nil and the returned value is 0.
170606
func (met *Metrics) Get(name string) (int64, error) {
	if metric := met.tryGetMetric(name); metric != nil {
		return atomic.LoadInt64(metric), nil
	}

	if rate := met.tryGetRate(name); rate != nil {
		return *rate, nil
	}

	// Neither rate nor metric found
	return 0, fmt.Errorf("Metric %s not found", name)
}
1280023
func (c *Cache) Get(key string) (value interface{}, err error) {
	out := struct {
		Cache string      `json:"cache"`
		Key   string      `json:"key"`
		Value interface{} `json:"value"`
	}{}
	if err = c.caches(c.Name, "items", key).Req("GET", nil, &out); err == nil {
		value = out.Value
	}
	return
}
904523
func (r Rune) Get() (rune, error) {
	if !r.Present() {
		var zero rune
		return zero, errors.New("value not present")
	}
	return *r.value, nil
}
1201608
func (b *Backend) Get(ctx context.Context, key string) (retEntry *physical.Entry, retErr error) {
	defer metrics.MeasureSince(metricGet, time.Now())

	// Pooling
	b.permitPool.Acquire()
	defer b.permitPool.Release()

	// Read
	r, err := b.client.Bucket(b.bucket).Object(key).NewReader(ctx)
	if err == storage.ErrObjectNotExist {
		return nil, nil
	}
	if err != nil {
		return nil, errwrap.Wrapf(fmt.Sprintf("failed to read value for %q: {{err}}", key), err)
	}

	defer func() {
		closeErr := r.Close()
		if closeErr != nil {
			retErr = multierror.Append(retErr, errwrap.Wrapf("error closing connection: {{err}}", closeErr))
		}
	}()

	value, err := ioutil.ReadAll(r)
	if err != nil {
		return nil, errwrap.Wrapf("failed to read value into a string: {{err}}", err)
	}

	return &physical.Entry{
		Key:   key,
		Value: value,
	}, nil
}
238363
func (f *Value) Get() (interface{}, error) {
	// Try outside of a lock
	if ok, value, err := f.get(); ok {
		return value, err
	}

	f.RLock()
	defer f.RUnlock()

	_, value, err := f.get()
	return value, err
}
447119
func (v Float32) Get(deflt float32) float32 {
	if !v.Defined {
		return deflt
	}
	return v.V
}
715087
func (e Error) Get() (error, error) {
	if !e.Present() {
		var zero error
		return zero, errors.New("value not present")
	}
	return *e.value, nil
}
1180706
func (c *Client) Get(uri string, timeout time.Duration) ([]byte, error) {
	if timeout < 0 {
		timeout = 0
	}
	reader, err := c.Do(uri, timeout, false)
	if err != nil {
		return nil, err
	}
	defer reader.Close()
	return ioutil.ReadAll(reader)
}
1131420
func (c *HTTPClient) Get(url string) (*http.Response, error) {
	var resp *http.Response
	breaker := c.breakerLookup(url)
	err := breaker.Call(func() error {
		aresp, err := c.Client.Get(url)
		resp = aresp
		return err
	}, c.timeout)
	return resp, err
}
1075045
func (v *Value) Get() interface{} {
	switch v.typ {
	case TBool:
		return v.GetBool()
	case TI8:
		return v.GetI8()
	case TDouble:
		return v.GetDouble()
	case TI16:
		return v.GetI16()
	case TI32:
		return v.GetI32()
	case TI64:
		return v.GetI64()
	case TBinary:
		return v.GetBinary()
	case TStruct:
		return v.GetStruct()
	case TMap:
		return v.GetMap()
	case TSet, TList:
		return v.GetList()
	default:
		panic(fmt.Sprintf("Unknown value type %v", v.typ))
	}
}
39049
func (c *Cache) Get(key string) (value interface{}, ok bool) {
	if !c.nolock {
		c.mu.Lock()
		defer c.mu.Unlock()
	}
	if ele, hit := c.cache[key]; hit {
		c.ll.MoveToFront(ele)
		return ele.Value.(*entry).value, true
	}
	return
}
794380
func (vs *ValueMap) Get(k Value) Value {
	if vs != nil {
		if v, ok := vs.hashMap.Get(k); ok {
			return v.(Value)
		}
	}
	return nil
}
161387
func (json *JSON) Get(name string) interface{} {
	return json.Result.Get(name).Value()
}
314410
func (c *Cache) Get(u interface{}) (i interface{}, err error) {

	c.Lock()
	defer c.Unlock()

	if _, ok := c.data[u]; !ok {
		return nil, errors.New("not found")
	}

	return c.data[u].value, nil
}
169346
func (c *Client) Get(URI string, decoded interface{}) (*http.Response, error) {
	req, err := c.NewJSONRequest("GET", URI, nil)
	if err != nil {
		return nil, err
	}
	resp, err := c.DoRest(req, decoded)
	if err != nil {
		return nil, err
	}
	if resp.StatusCode != http.StatusOK {
		return nil, fmt.Errorf("Unexpected http code %d on URL %v. expecting %d", resp.StatusCode, resp.Request.URL, http.StatusOK)
	}
	return resp, err
}
175060
func (i Int) Get() (int, error) {
	if !i.Present() {
		var zero int
		return zero, errors.New("value not present")
	}
	return *i.value, nil
}
344537
func (r *FastHttpResponse) Get(key int) (value interface{}, err error) {
	switch key {
	case revel.HTTP_SERVER_HEADER:
		value = r.Header()
	case revel.HTTP_STREAM_WRITER:
		value = r
	case revel.HTTP_WRITER:
		value = r.Writer
	default:
		err = revel.ENGINE_UNKNOWN_GET
	}
	return
}