github.com/cilium/cilium@v1.16.2/api/v1/models/bgp_graceful_restart.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 // BgpGracefulRestart BGP graceful restart parameters negotiated with the peer. 19 // 20 // +k8s:deepcopy-gen=true 21 // 22 // swagger:model BgpGracefulRestart 23 type BgpGracefulRestart struct { 24 25 // When set, graceful restart capability is negotiated for all AFI/SAFIs of 26 // this peer. 27 Enabled bool `json:"enabled,omitempty"` 28 29 // This is the time advertised to peer for the BGP session to be re-established 30 // after a restart. After this period, peer will remove stale routes. 31 // (RFC 4724 section 4.2) 32 RestartTimeSeconds int64 `json:"restart-time-seconds,omitempty"` 33 } 34 35 // Validate validates this bgp graceful restart 36 func (m *BgpGracefulRestart) Validate(formats strfmt.Registry) error { 37 return nil 38 } 39 40 // ContextValidate validates this bgp graceful restart based on context it is used 41 func (m *BgpGracefulRestart) ContextValidate(ctx context.Context, formats strfmt.Registry) error { 42 return nil 43 } 44 45 // MarshalBinary interface implementation 46 func (m *BgpGracefulRestart) MarshalBinary() ([]byte, error) { 47 if m == nil { 48 return nil, nil 49 } 50 return swag.WriteJSON(m) 51 } 52 53 // UnmarshalBinary interface implementation 54 func (m *BgpGracefulRestart) UnmarshalBinary(b []byte) error { 55 var res BgpGracefulRestart 56 if err := swag.ReadJSON(b, &res); err != nil { 57 return err 58 } 59 *m = res 60 return nil 61 }