// Status sets http statusCode. It is a shorthand for "WriteHeader" method
// in order to keep method chaining.
768480
func (r *Response) Status(code int) JResponseWriter {
	r.code = code
	return r
}
1176559
func (c *criOClient) Status() *models.Status {
	if c == nil {
		return &models.Status{State: models.StatusStateDisabled}
	}

	criStatus := c.cri.Status()
	criStatusMsg := fmt.Sprintf("cri-o client: %s - %s", criStatus.State, criStatus.Msg)

	return &models.Status{
		State: criStatus.State,
		Msg:   criStatusMsg,
	}
}
443334
func (s *OrderService) Status(orderID int64) (Order, error) {

	payload := map[string]interface{}{
		"order_id": orderID,
	}

	req, err := s.client.newAuthenticatedRequest("POST", "order/status", payload)

	if err != nil {
		return Order{}, err
	}

	order := new(Order)
	_, err = s.client.do(req, order)
	if err != nil {
		return *order, err
	}

	return *order, nil
}
319650
func (w *statusResponseWriter) WriteHeader(statusCode int) {
	w.statusCode = statusCode
	w.ResponseWriter.WriteHeader(statusCode)
}
954955
func (c *TokenController) Status(ctx *app.StatusTokenContext) error {
	appToken, errorResponse, err := c.app.TokenService().RetrieveExternalToken(ctx, ctx.For, ctx.RequestData, ctx.ForcePull)
	if errorResponse != nil {
		ctx.ResponseData.Header().Add("Access-Control-Expose-Headers", "WWW-Authenticate")
		ctx.ResponseData.Header().Set("WWW-Authenticate", *errorResponse)
	}
	if err != nil {
		log.Error(ctx, map[string]interface{}{
			"err": err,
		}, "failed to check token status")
		return jsonapi.JSONErrorResponse(ctx, err)
	}

	tokenStatus := &app.ExternalTokenStatus{
		Username:       appToken.Username,
		ProviderAPIURL: appToken.ProviderAPIURL,
	}
	return ctx.OK(tokenStatus)
}
994841
func (h *HTTP) Status() (interface{}, error) {
	resp, err := h.do()
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()

	// Check if StatusCode matches
	if resp.StatusCode != h.Config.StatusCode {
		return nil, fmt.Errorf("Received status code '%v' does not match expected status code '%v'",
			resp.StatusCode, h.Config.StatusCode)
	}

	// If Expect is set, verify if returned response contains expected data
	if h.Config.Expect != "" {
		data, err := ioutil.ReadAll(resp.Body)
		if err != nil {
			return nil, fmt.Errorf("Unable to read response body to perform content expectancy check: %v", err)
		}

		if !strings.Contains(string(data), h.Config.Expect) {
			return nil, fmt.Errorf("Received response body '%v' does not contain expected content '%v'",
				string(data), h.Config.Expect)
		}
	}

	return nil, nil
}
210679
func (c *criClient) Status() *models.Status {
	if c == nil {
		return &models.Status{State: models.StatusStateDisabled}
	}

	sreq := &criRuntime.StatusRequest{
		Verbose: false,
	}
	sresp, err := c.RuntimeServiceClient.Status(context.Background(), sreq)
	if err != nil {
		return &models.Status{State: models.StatusStateFailure, Msg: err.Error()}
	}
	for _, runtimeCondition := range sresp.Status.Conditions {
		if !runtimeCondition.Status {
			return &models.Status{State: models.StatusStateFailure, Msg: runtimeCondition.Message}
		}

	}
	return &models.Status{State: models.StatusStateOk, Msg: "cri daemon: Ok"}
}
167957
func (pool *Pool) Status(addr, handle string) (status *Status, err error) {
	if client, ok := pool.Clients[addr]; ok {
		client.Lock()
		defer client.Unlock()
		status, err = client.Status(handle)
	} else {
		err = ErrNotFound
	}
	return
}
805389
func (c *OperatorRekeyCommand) status(client *api.Client) int {
	// Handle the different API requests
	var fn func() (interface{}, error)
	switch strings.ToLower(strings.TrimSpace(c.flagTarget)) {
	case "barrier":
		fn = func() (interface{}, error) {
			return client.Sys().RekeyStatus()
		}
		if c.flagVerify {
			fn = func() (interface{}, error) {
				return client.Sys().RekeyVerificationStatus()
			}
		}
	case "recovery", "hsm":
		fn = func() (interface{}, error) {
			return client.Sys().RekeyRecoveryKeyStatus()
		}
		if c.flagVerify {
			fn = func() (interface{}, error) {
				return client.Sys().RekeyRecoveryKeyVerificationStatus()
			}
		}
	default:
		c.UI.Error(fmt.Sprintf("Unknown target: %s", c.flagTarget))
		return 1
	}

	// Make the request
	status, err := fn()
	if err != nil {
		c.UI.Error(fmt.Sprintf("Error reading rekey status: %s", err))
		return 2
	}

	return c.printStatus(status)
}
191570
func (f Future) Status() string {
	if f.pt == nil {
		return ""
	}
	return f.pt.pollingStatus()
}
886708
func (c *SearchCall) Status(status string) *SearchCall {
	c.urlParams_.Set("status", status)
	return c
}
142344
func (c *customCheck) Status() (interface{}, error) {
	// perform some sort of check
	if false {
		return nil, fmt.Errorf("Something major just broke")
	}

	// You can return additional information pertaining to the check as long
	// as it can be JSON marshalled
	return map[string]int{"foo": 123, "bar": 456}, nil
}
336555
func StatusHandler(w http.ResponseWriter, r *http.Request) {
	code, _ := strconv.Atoi(mux.Vars(r)["code"])

	statusWritten := false
	switch code {
	case http.StatusMovedPermanently,
		http.StatusFound,
		http.StatusSeeOther,
		http.StatusUseProxy,
		http.StatusTemporaryRedirect:
		w.Header().Set("Location", "/redirect/1")
	case http.StatusUnauthorized: // 401
		w.Header().Set("WWW-Authenticate", `Basic realm="Fake Realm"`)
	case http.StatusPaymentRequired: // 402
		w.WriteHeader(code)
		statusWritten = true
		io.WriteString(w, "Fuck you, pay me!")
		w.Header().Set("x-more-info", "http://vimeo.com/22053820")
	case http.StatusNotAcceptable: // 406
		w.WriteHeader(code)
		statusWritten = true
		io.WriteString(w, `{"message": "Client did not request a supported media type.", "accept": ["image/webp", "image/svg+xml", "image/jpeg", "image/png", "image/*"]}`)
	case http.StatusTeapot:
		w.WriteHeader(code)
		statusWritten = true
		w.Header().Set("x-more-info", "http://tools.ietf.org/html/rfc2324")
		io.WriteString(w, `
    -=[ teapot ]=-

       _...._
     .'  _ _ '.
    | ."  ^  ". _,
    \_;'"---"'|//
      |       ;/
      \_     _/
        '"""'
`)
	}
	if !statusWritten {
		w.WriteHeader(code)
	}
}
1103566
func (client *Client) Status(handle string) (status *Status, err error) {
	if client.conn == nil {
		return nil, ErrLostConn
	}
	var mutex sync.Mutex
	mutex.Lock()
	client.innerHandler.put("s"+handle, func(resp *Response) {
		defer mutex.Unlock()
		var err error
		status, err = resp._status()
		if err != nil {
			client.err(err)
		}
	})
	req := getRequest()
	req.DataType = dtGetStatus
	req.Data = []byte(handle)
	client.write(req)
	mutex.Lock()
	return
}
925225
func (m *Master) Status() (err error) {
	u := url.URL{
		Scheme: "http",
		Host:   m.Url,
		Path:   "/dir/status",
	}
	resp, err := http.Get(u.String())
	if err != nil {
		return
	}

	defer resp.Body.Close()

	status := new(systemStatus)
	if err = decodeJson(resp.Body, status); err != nil {
		log.Println(err)
		return
	}

	if status.Error != "" {
		err = errors.New(status.Error)
		log.Println(err)
		return
	}
	return
}
768388
func (s *Server) Status(ctx context.Context,
	in *StatusRequest) (*StatusResponse, error) {

	return &StatusResponse{
		Active: s.manager.IsActive(),
	}, nil
}
511316
func (c *Client) Status() (*status.Status, error) {
	type statusResponse struct {
		Data status.Status `json:"data"`
	}
	s := &statusResponse{}
	if err := c.Get(status.Path, s); err != nil {
		return nil, err
	}
	return &s.Data, nil
}