forked from openshift/assisted-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathip.go
38 lines (29 loc) · 880 Bytes
/
ip.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/validate"
)
// IP ip
//
// swagger:model ip
type IP string
// Validate validates this ip
func (m IP) Validate(formats strfmt.Registry) error {
var res []error
if err := validate.Pattern("", "body", string(m), `^(?:(?:(?:[0-9]{1,3}\.){3}[0-9]{1,3})|(?:(?:[0-9a-fA-F]*:[0-9a-fA-F]*){2,}))?$`); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// ContextValidate validates this ip based on context it is used
func (m IP) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}