Skip to main content

parser.go

parser.go - Overview

  1. Overview This file contains functions for parsing HTTP requests related to metrics explorer, extracting parameters for filter key/value suggestions, summary list metrics, tree map metrics, related metrics, inspect metrics, and updating metrics metadata.

  2. Detailed Documentation

    ParseFilterKeySuggestions(r *http.Request) (*metrics_explorer.FilterKeyRequest, *model.ApiError)

    • Purpose: Parses the HTTP request to extract parameters for filter key suggestions.
    • Parameters:
      • r: *http.Request - The HTTP request object.
    • Returns:
      • *metrics_explorer.FilterKeyRequest: A pointer to a FilterKeyRequest struct containing the parsed parameters.
      • *model.ApiError: A pointer to an ApiError struct if an error occurs during parsing.

    ParseFilterValueSuggestions(r *http.Request) (*metrics_explorer.FilterValueRequest, *model.ApiError)

    • Purpose: Parses the HTTP request body to extract parameters for filter value suggestions.
    • Parameters:
      • r: *http.Request - The HTTP request object.
    • Returns:
      • *metrics_explorer.FilterValueRequest: A pointer to a FilterValueRequest struct containing the parsed parameters.
      • *model.ApiError: A pointer to an ApiError struct if an error occurs during parsing.

    ParseSummaryListMetricsParams(r *http.Request) (*metrics_explorer.SummaryListMetricsRequest, *model.ApiError)

    • Purpose: Parses the HTTP request body to extract parameters for listing summary metrics.
    • Parameters:
      • r: *http.Request - The HTTP request object.
    • Returns:
      • *metrics_explorer.SummaryListMetricsRequest: A pointer to a SummaryListMetricsRequest struct containing the parsed parameters.
      • *model.ApiError: A pointer to an ApiError struct if an error occurs during parsing.

    ParseTreeMapMetricsParams(r *http.Request) (*metrics_explorer.TreeMapMetricsRequest, *model.ApiError)

    • Purpose: Parses the HTTP request body to extract parameters for tree map metrics.
    • Parameters:
      • r: *http.Request - The HTTP request object.
    • Returns:
      • *metrics_explorer.TreeMapMetricsRequest: A pointer to a TreeMapMetricsRequest struct containing the parsed parameters.
      • *model.ApiError: A pointer to an ApiError struct if an error occurs during parsing.

    ParseRelatedMetricsParams(r *http.Request) (*metrics_explorer.RelatedMetricsRequest, *model.ApiError)

    • Purpose: Parses the HTTP request body to extract parameters for related metrics.
    • Parameters:
      • r: *http.Request - The HTTP request object.
    • Returns:
      • *metrics_explorer.RelatedMetricsRequest: A pointer to a RelatedMetricsRequest struct containing the parsed parameters.
      • *model.ApiError: A pointer to an ApiError struct if an error occurs during parsing.

    ParseInspectMetricsParams(r *http.Request) (*metrics_explorer.InspectMetricsRequest, *model.ApiError)

    • Purpose: Parses the HTTP request body to extract parameters for inspecting metrics.
    • Parameters:
      • r: *http.Request - The HTTP request object.
    • Returns:
      • *metrics_explorer.InspectMetricsRequest: A pointer to an InspectMetricsRequest struct containing the parsed parameters.
      • *model.ApiError: A pointer to an ApiError struct if an error occurs during parsing.

    ParseUpdateMetricsMetadataParams(r *http.Request) (*metrics_explorer.UpdateMetricsMetadataRequest, *model.ApiError)

    • Purpose: Parses the HTTP request body and route variables to extract parameters for updating metrics metadata.
    • Parameters:
      • r: *http.Request - The HTTP request object.
    • Returns:
      • *metrics_explorer.UpdateMetricsMetadataRequest: A pointer to an UpdateMetricsMetadataRequest struct containing the parsed parameters.
      • *model.ApiError: A pointer to an ApiError struct if an error occurs during parsing or if validation fails.
  3. Code Examples

    None

  4. Clarity and Accuracy

    All documented functions have clear descriptions and parameter/return value explanations.

  5. Markdown & MDX Perfection

    The documentation uses proper markdown syntax for headings, lists, and code blocks.

  6. Edge Cases To Avoid Breaking MDX

    • No unescaped special characters.
    • No broken links or images.
    • No raw HTML tags.
    • No HTML comments.
    • No tables.
    • Lists are properly indented.
    • Code blocks and headings are properly closed.
  7. Getting Started Relevance Include in Getting Started: NO