Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultAPIServerConfig = APIServerConfig{ ReadHeaderTimeout: 10 * time.Second, ReadTimeout: 20 * time.Second, WriteTimeout: 20 * time.Second, RequestHandlerTimeout: 30 * time.Second, RequestHandlerTimeoutByURI: map[string]time.Duration{}, MaxBytesToReadInBody: 10 * datasize.MB, }
View Source
var LINESOFLOGTOPRINT = 100
Functions ¶
func GenerateHealthData ¶
func GenerateHealthData() types.HealthInfo
func MountUsage ¶
func MountUsage(path string) (disk types.MountStatus)
Function to get disk usage of path/disk
Types ¶
type APIClient ¶
APIClient is a utility for interacting with a node's API server.
func NewAPIClient ¶
NewAPIClient returns a new client for a node's API server.
type APIServer ¶
APIServer configures a node's public REST API.
func NewAPIServer ¶
func NewAPIServer(params APIServerParams) (*APIServer, error)
func (*APIServer) ListenAndServe ¶
@title Bacalhau API @description This page is the reference of the Bacalhau REST API. Project docs are available at https://docs.bacalhau.org/. Find more information about Bacalhau at https://github.com/bacalhau-project/bacalhau. @contact.name Bacalhau Team @contact.url https://github.com/bacalhau-project/bacalhau @contact.email team@bacalhau.org @license.name Apache 2.0 @license.url https://github.com/bacalhau-project/bacalhau/blob/main/LICENSE @host bootstrap.production.bacalhau.org:1234 @BasePath / @schemes http
ListenAndServe listens for and serves HTTP requests against the API server.
func (*APIServer) RegisterHandlers ¶
func (apiServer *APIServer) RegisterHandlers(config ...HandlerConfig) error
type APIServerConfig ¶
type APIServerConfig struct { // These are TCP connection deadlines and not HTTP timeouts. They don't control the time it takes for our handlers // to complete. Deadlines operate on the connection, so our server will fail to return a result only after // the handlers try to access connection properties ReadHeaderTimeout time.Duration // the amount of time allowed to read request headers ReadTimeout time.Duration // the maximum duration for reading the entire request, including the body WriteTimeout time.Duration // the maximum duration before timing out writes of the response // This represents maximum duration for handlers to complete, or else fail the request with 503 error code. RequestHandlerTimeout time.Duration RequestHandlerTimeoutByURI map[string]time.Duration // MaxBytesToReadInBody is used by safeHandlerFuncWrapper as the max size of body MaxBytesToReadInBody datasize.ByteSize }
type APIServerParams ¶
type APIServerParams struct { Address string Port int Host host.Host NodeInfoProvider model.NodeInfoProvider Config APIServerConfig }
type HandlerConfig ¶
type VersionRequest ¶
type VersionRequest struct {
ClientID string `json:"client_id" example:"ac13188e93c97a9c2e7cf8e86c7313156a73436036f30da1ececc2ce79f9ea51"`
}
type VersionResponse ¶
type VersionResponse struct {
VersionInfo *model.BuildVersionInfo `json:"build_version_info"`
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.