...

Source file src/github.com/sigstore/timestamp-authority/pkg/generated/models/error.go

Documentation: github.com/sigstore/timestamp-authority/pkg/generated/models

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  // Copyright 2022 The Sigstore Authors.
     4  //
     5  // Licensed under the Apache License, Version 2.0 (the "License");
     6  // you may not use this file except in compliance with the License.
     7  // You may obtain a copy of the License at
     8  //
     9  //     http://www.apache.org/licenses/LICENSE-2.0
    10  //
    11  // Unless required by applicable law or agreed to in writing, software
    12  // distributed under the License is distributed on an "AS IS" BASIS,
    13  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14  // See the License for the specific language governing permissions and
    15  // limitations under the License.
    16  //
    17  
    18  package models
    19  
    20  // This file was generated by the swagger tool.
    21  // Editing this file might prove futile when you re-run the swagger generate command
    22  
    23  import (
    24  	"context"
    25  
    26  	"github.com/go-openapi/strfmt"
    27  	"github.com/go-openapi/swag"
    28  )
    29  
    30  // Error error
    31  //
    32  // swagger:model Error
    33  type Error struct {
    34  
    35  	// code
    36  	Code int64 `json:"code,omitempty"`
    37  
    38  	// message
    39  	Message string `json:"message,omitempty"`
    40  }
    41  
    42  // Validate validates this error
    43  func (m *Error) Validate(formats strfmt.Registry) error {
    44  	return nil
    45  }
    46  
    47  // ContextValidate validates this error based on context it is used
    48  func (m *Error) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
    49  	return nil
    50  }
    51  
    52  // MarshalBinary interface implementation
    53  func (m *Error) MarshalBinary() ([]byte, error) {
    54  	if m == nil {
    55  		return nil, nil
    56  	}
    57  	return swag.WriteJSON(m)
    58  }
    59  
    60  // UnmarshalBinary interface implementation
    61  func (m *Error) UnmarshalBinary(b []byte) error {
    62  	var res Error
    63  	if err := swag.ReadJSON(b, &res); err != nil {
    64  		return err
    65  	}
    66  	*m = res
    67  	return nil
    68  }
    69  

View as plain text