github.com/cilium/cilium@v1.16.2/api/v1/models/bgp_nlri.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  // BgpNlri Network Layer Reachability Information (NLRI) of the path
    19  //
    20  // swagger:model BgpNlri
    21  type BgpNlri struct {
    22  
    23  	// Base64-encoded NLRI in the BGP UPDATE message format
    24  	Base64 string `json:"base64,omitempty"`
    25  }
    26  
    27  // Validate validates this bgp nlri
    28  func (m *BgpNlri) Validate(formats strfmt.Registry) error {
    29  	return nil
    30  }
    31  
    32  // ContextValidate validates this bgp nlri based on context it is used
    33  func (m *BgpNlri) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
    34  	return nil
    35  }
    36  
    37  // MarshalBinary interface implementation
    38  func (m *BgpNlri) MarshalBinary() ([]byte, error) {
    39  	if m == nil {
    40  		return nil, nil
    41  	}
    42  	return swag.WriteJSON(m)
    43  }
    44  
    45  // UnmarshalBinary interface implementation
    46  func (m *BgpNlri) UnmarshalBinary(b []byte) error {
    47  	var res BgpNlri
    48  	if err := swag.ReadJSON(b, &res); err != nil {
    49  		return err
    50  	}
    51  	*m = res
    52  	return nil
    53  }