github.com/kubearmor/cilium@v1.6.12/api/v1/models/metric.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package models
     4  
     5  // This file was generated by the swagger tool.
     6  // Editing this file might prove futile when you re-run the swagger generate command
     7  
     8  import (
     9  	strfmt "github.com/go-openapi/strfmt"
    10  
    11  	"github.com/go-openapi/swag"
    12  )
    13  
    14  // Metric Metric information
    15  // swagger:model Metric
    16  type Metric struct {
    17  
    18  	// Labels of the metric
    19  	Labels map[string]string `json:"labels,omitempty"`
    20  
    21  	// Name of the metric
    22  	Name string `json:"name,omitempty"`
    23  
    24  	// Value of the metric
    25  	Value float64 `json:"value,omitempty"`
    26  }
    27  
    28  // Validate validates this metric
    29  func (m *Metric) Validate(formats strfmt.Registry) error {
    30  	return nil
    31  }
    32  
    33  // MarshalBinary interface implementation
    34  func (m *Metric) MarshalBinary() ([]byte, error) {
    35  	if m == nil {
    36  		return nil, nil
    37  	}
    38  	return swag.WriteJSON(m)
    39  }
    40  
    41  // UnmarshalBinary interface implementation
    42  func (m *Metric) UnmarshalBinary(b []byte) error {
    43  	var res Metric
    44  	if err := swag.ReadJSON(b, &res); err != nil {
    45  		return err
    46  	}
    47  	*m = res
    48  	return nil
    49  }