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