github.com/cloudwan/edgelq-sdk@v1.15.4/logging/resources/v1/common/common.pb.validate.go (about)

     1  // Code generated by protoc-gen-goten-validate
     2  // File: edgelq/logging/proto/v1/common.proto
     3  // DO NOT EDIT!!!
     4  
     5  package common
     6  
     7  import (
     8  	"bytes"
     9  	"errors"
    10  	"fmt"
    11  	"net"
    12  	"net/url"
    13  	"regexp"
    14  	"strings"
    15  	"time"
    16  	"unicode/utf8"
    17  
    18  	gotenvalidate "github.com/cloudwan/goten-sdk/runtime/validate"
    19  )
    20  
    21  // proto imports
    22  import (
    23  	timestamppb "google.golang.org/protobuf/types/known/timestamppb"
    24  )
    25  
    26  var (
    27  	_ = bytes.Equal
    28  	_ = errors.New
    29  	_ = fmt.Errorf
    30  	_ = net.ParseIP
    31  	_ = regexp.Match
    32  	_ = strings.Split
    33  	_ = time.Now
    34  	_ = utf8.RuneCountInString
    35  	_ = url.Parse
    36  	_ = gotenvalidate.NewValidationError
    37  
    38  	validation_regex_LabelDescriptor_key_c12b6926c4eb549aa691c1ddf8b26524 = regexp.MustCompile("^[_A-Za-z][_A-Za-z0-9]{0,63}$")
    39  )
    40  
    41  // make sure we're using proto imports
    42  var (
    43  	_ = &timestamppb.Timestamp{}
    44  )
    45  
    46  func (obj *LabelDescriptor) GotenValidate() error {
    47  	if obj == nil {
    48  		return nil
    49  	}
    50  	if !validation_regex_LabelDescriptor_key_c12b6926c4eb549aa691c1ddf8b26524.Match([]byte(obj.Key)) {
    51  		return gotenvalidate.NewValidationError("LabelDescriptor", "key", obj.Key, "field must match the regex ^[_A-Za-z][_A-Za-z0-9]{0,63}$", nil)
    52  	}
    53  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    54  		return cvobj.GotenCustomValidate()
    55  	}
    56  	return nil
    57  }
    58  func (obj *LabelKeySet) GotenValidate() error {
    59  	if obj == nil {
    60  		return nil
    61  	}
    62  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    63  		return cvobj.GotenCustomValidate()
    64  	}
    65  	return nil
    66  }
    67  func (obj *TimeInterval) GotenValidate() error {
    68  	if obj == nil {
    69  		return nil
    70  	}
    71  	if obj.StartTime == nil {
    72  		return gotenvalidate.NewValidationError("TimeInterval", "startTime", obj.StartTime, "field is required", nil)
    73  	}
    74  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    75  		return cvobj.GotenCustomValidate()
    76  	}
    77  	return nil
    78  }