// GetFlashObj unmarshals a flash message from the session into the users pointer
// then deletes it from the session.
515145
func GetFlashObj(overseer Overseer, w http.ResponseWriter, r *http.Request, key string, pointer interface{}) error {
	val, err := GetFlash(overseer, w, r, key)
	if err != nil {
		return errors.Wrap(err, "unable to get flash object")
	}

	return json.Unmarshal([]byte(val), pointer)
}
1166893
func (connection *Connection) getInjectBuf(reply bool) InjectBuf {
	if reply {
		return connection.ReplyBuf
	}
	return connection.OrigBuf
}
986101
func (e *Event) GetObjectValue(keys ...string) string {
	return getValue(e.Data.Object, keys)
}
614286
func (m Metadata) GetObject(key string) (Metadata, error) {
	val, ok := m[key]
	if !ok {
		return nil, ErrMetadataNonexistantKey
	}
	if val.Type != MetadataValueTypeObject {
		return nil, ErrMetadataUnexpectedValueType
	}
	out, _ := val.Value.(Metadata)
	return out, nil
}
1089788
func (c *Client) GetWebSessionInfo(user string, sid string) (services.WebSession, error) {
	out, err := c.Get(
		c.Endpoint("users", user, "web", "sessions", sid), url.Values{})
	if err != nil {
		return nil, trace.Wrap(err)
	}
	return services.GetWebSessionMarshaler().UnmarshalWebSession(out.Bytes())
}
488878
func (l *s3EncObjects) GetObject(ctx context.Context, bucket string, key string, startOffset int64, length int64, writer io.Writer, etag string, opts minio.ObjectOptions) error {
	return l.getObject(ctx, bucket, key, startOffset, length, writer, etag, opts)
}
748973
func (b *Bucket) GetObject(key string, opts ...option.GetObjectInput) (*s3.GetObjectOutput, error) {
	req := &s3.GetObjectInput{
		Bucket: b.Name,
		Key:    aws.String(key),
	}

	for _, f := range opts {
		f(req)
	}

	return b.S3.GetObject(req)
}
637405
func FlashFilter(c *Controller, fc []Filter) {
	c.Flash = restoreFlash(c.Request)
	c.ViewArgs["flash"] = c.Flash.Data

	fc[0](c, fc[1:])

	// Store the flash.
	var flashValue string
	for key, value := range c.Flash.Out {
		flashValue += "\x00" + key + ":" + value + "\x00"
	}
	c.SetCookie(&http.Cookie{
		Name:     CookiePrefix + "_FLASH",
		Value:    url.QueryEscape(flashValue),
		HttpOnly: true,
		Secure:   CookieSecure,
		Path:     "/",
	})
}
495025
func (f *Flash) GetBool(key string) bool {
	r, _ := f.Get(key).(bool)
	return r
}
126744
func (r RequestParams) GetIntUnslashed(key string) (int, bool) {
	v := r.Get(key)
	if v != "" {
		if len(v) > 1 {
			if v[0] == '/' {
				v = v[1:]
			}
		}

		vInt, err := strconv.Atoi(v)
		if err != nil {
			return -1, false
		}
		return vInt, true
	}

	return -1, false
}
749240
func (c *Client) GetObject(path, objectName string) ([]byte, error) {
	var resp []byte
	requestHeaders := make(http.Header)
	requestHeaders.Set("Accept", "*/*")
	req := request{
		method:    client.GET,
		url:       makeURL(apiStorage, path, objectName),
		reqHeader: requestHeaders,
		resp:      &resp,
	}
	respData, err := c.sendRequest(req)
	if err != nil {
		return nil, errors.Newf(err, "failed to get object %s/%s", path, objectName)
	}
	res, ok := respData.RespValue.(*[]byte)
	if !ok {
		return nil, errors.Newf(err, "failed to assert downloaded data as type *[]byte for object %s/%s", path, objectName)
	}
	return *res, nil
}
752581
func (v *StructB) GetAb() (o *StructA) {
	if v != nil {
		o = v.Ab
	}
	return
}
1177461
func (_class HostClass) GetCrashdumps(sessionID SessionRef, self HostRef) (_retval []HostCrashdumpRef, _err error) {
	_method := "host.get_crashdumps"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertHostRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg)
	if _err != nil {
		return
	}
	_retval, _err = convertHostCrashdumpRefSetToGo(_method + " -> ", _result.Value)
	return
}
829508
func (s *Session) AddFlash(value interface{}, vars ...string) {
	key := flashesKey
	if len(vars) > 0 {
		key = vars[0]
	}
	var flashes []interface{}
	if v, ok := s.Values[key]; ok {
		flashes = v.([]interface{})
	}
	s.Values[key] = append(flashes, value)
}
1315833
func (cp *ConsulClient) GetObj(key string, retVal interface{}) error {
	key = processKey("/contiv.io/obj/" + processKey(key))

	resp, _, err := cp.client.KV().Get(key, &api.QueryOptions{RequireConsistent: true})
	if err != nil {
		if api.IsServerError(err) || strings.Contains(err.Error(), "EOF") ||
			strings.Contains(err.Error(), "connection refused") {
			for i := 0; i < maxConsulRetries; i++ {
				resp, _, err = cp.client.KV().Get(key, &api.QueryOptions{RequireConsistent: true})
				if err == nil {
					break
				}

				// Retry after a delay
				time.Sleep(time.Second)
			}
		}

		// return error if it failed after retries
		if err != nil {
			return err
		}
	}
	// Consul returns success and a nil kv when a key is not found,
	// translate it to 'Key not found' error
	if resp == nil {
		return errors.New("Key not found")
	}

	// Parse JSON response
	if err := json.Unmarshal(resp.Value, retVal); err != nil {
		log.Errorf("Error parsing object %v, Err %v", resp.Value, err)
		return err
	}

	return nil
}
208130
func (d *discardSessionServer) GetSession(namespace string, id ID) (*Session, error) {
	return &Session{}, nil
}
1187186
func (s *Session) GetFlashStringDefault(key string, defaultValue string) string {
	if value := s.GetFlash(key); value != nil {
		if v, ok := value.(string); ok {
			return v
		}
	}

	return defaultValue
}