github.com/ravendb/ravendb-go-client@v0.0.0-20240229102137-4474ee7aa0fa/serverwide/operations/operation_database_health_check.go (about)

     1  package operations
     2  
     3  import (
     4  	"github.com/ravendb/ravendb-go-client"
     5  	"net/http"
     6  )
     7  
     8  type OperationDatabaseHealthCheck struct {}
     9  
    10  func (operation * OperationDatabaseHealthCheck) GetCommand(conventions *ravendb.DocumentConventions) (ravendb.RavenCommand, error) {
    11  	return &getDatabaseHealthCheckOperation{
    12  		RavenCommandBase: ravendb.RavenCommandBase{
    13  			ResponseType: ravendb.RavenCommandResponseTypeEmpty,
    14  		},
    15  	}, nil
    16  }
    17  
    18  type getDatabaseHealthCheckOperation struct {
    19  	ravendb.RavenCommandBase
    20  }
    21  
    22  func (c *getDatabaseHealthCheckOperation) CreateRequest(node *ravendb.ServerNode) (*http.Request, error) {
    23  	url := node.URL + "/databases/" + node.Database + "/healthcheck"
    24  	return http.NewRequest(http.MethodGet, url, nil)
    25  }
    26  func (c *getDatabaseHealthCheckOperation) SetResponse(response []byte, fromCache bool) error {
    27  	return nil
    28  }