Skip to main content

clickhouse.go

clickhouse.go - Overview

  1. Overview Defines custom error types related to resource limits in ClickHouse, including ErrResourceBytesLimitExceeded, ErrResourceTimeLimitExceeded, and ResourceLimitError, along with functions to create, check, and marshal/unmarshal these errors.

  2. Detailed Documentation

ErrResourceBytesLimitExceeded

  • Purpose: An error indicating that the resource bytes limit has been exceeded.
  • Type: error
  • Value: A ResourceLimitError with a specific message.

ErrResourceTimeLimitExceeded

  • Purpose: An error indicating that the resource time limit has been exceeded.
  • Type: error
  • Value: A ResourceLimitError with a specific message.

ResourceLimitError

  • Purpose: A custom error type to represent resource limit errors.
  • Fields:
    • err: The underlying error. Type: error.

NewResourceLimitError

  • Purpose: Creates a new ResourceLimitError.
  • Parameters:
    • err: The underlying error. Type: error.
  • Returns: An error of type *ResourceLimitError.

(*ResourceLimitError) Error

  • Purpose: Returns the error message of the underlying error.
  • Returns: The error message as a string. Type: string.

(*ResourceLimitError) Unwrap

  • Purpose: Returns the underlying error.
  • Returns: The underlying error. Type: error.

IsResourceLimitError

  • Purpose: Checks if an error is a ResourceLimitError.
  • Parameters:
    • err: The error to check. Type: error.
  • Returns: true if the error is a ResourceLimitError, false otherwise. Type: bool.

(*ResourceLimitError) MarshalJSON

  • Purpose: Marshals the error to JSON.
  • Returns: A JSON representation of the error. Type: []byte, error.

(*ResourceLimitError) UnmarshalJSON

  • Purpose: Unmarshals JSON to the error.
  • Parameters:
    • []byte: the json value to unmarshal.
  • Returns: An error, always nil in the current implementation. Type: error.
  1. Code Examples N/A

  2. Clarity and Accuracy All documentation is derived directly from the code.

  3. Markdown & MDX Perfection All markdown is properly formatted.

  4. Edge Cases To Avoid Breaking MDX No edge cases were broken.

Include in Getting Started: NO