github.com/cilium/cilium@v1.16.2/api/v1/models/recorder_mask_spec.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  // RecorderMaskSpec Configuration of a recorder mask
    19  //
    20  // swagger:model RecorderMaskSpec
    21  type RecorderMaskSpec struct {
    22  
    23  	// Layer 4 destination port mask
    24  	DstPortMask string `json:"dst-port-mask,omitempty"`
    25  
    26  	// Layer 3 destination IP mask
    27  	DstPrefixMask string `json:"dst-prefix-mask,omitempty"`
    28  
    29  	// Priority of this mask
    30  	Priority int64 `json:"priority,omitempty"`
    31  
    32  	// Layer 4 protocol mask
    33  	ProtocolMask string `json:"protocol-mask,omitempty"`
    34  
    35  	// Layer 4 source port mask
    36  	SrcPortMask string `json:"src-port-mask,omitempty"`
    37  
    38  	// Layer 3 source IP mask
    39  	SrcPrefixMask string `json:"src-prefix-mask,omitempty"`
    40  
    41  	// Number of users of this mask
    42  	Users int64 `json:"users,omitempty"`
    43  }
    44  
    45  // Validate validates this recorder mask spec
    46  func (m *RecorderMaskSpec) Validate(formats strfmt.Registry) error {
    47  	return nil
    48  }
    49  
    50  // ContextValidate validates this recorder mask spec based on context it is used
    51  func (m *RecorderMaskSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
    52  	return nil
    53  }
    54  
    55  // MarshalBinary interface implementation
    56  func (m *RecorderMaskSpec) MarshalBinary() ([]byte, error) {
    57  	if m == nil {
    58  		return nil, nil
    59  	}
    60  	return swag.WriteJSON(m)
    61  }
    62  
    63  // UnmarshalBinary interface implementation
    64  func (m *RecorderMaskSpec) UnmarshalBinary(b []byte) error {
    65  	var res RecorderMaskSpec
    66  	if err := swag.ReadJSON(b, &res); err != nil {
    67  		return err
    68  	}
    69  	*m = res
    70  	return nil
    71  }