1346 lines
33 KiB
Go
1346 lines
33 KiB
Go
// Code generated by protoc-gen-validate. DO NOT EDIT.
|
|
// source: dashboard.proto
|
|
|
|
package go_generate
|
|
|
|
import (
|
|
"bytes"
|
|
"errors"
|
|
"fmt"
|
|
"net"
|
|
"net/mail"
|
|
"net/url"
|
|
"regexp"
|
|
"sort"
|
|
"strings"
|
|
"time"
|
|
"unicode/utf8"
|
|
|
|
"google.golang.org/protobuf/types/known/anypb"
|
|
)
|
|
|
|
// ensure the imports are used
|
|
var (
|
|
_ = bytes.MinRead
|
|
_ = errors.New("")
|
|
_ = fmt.Print
|
|
_ = utf8.UTFMax
|
|
_ = (*regexp.Regexp)(nil)
|
|
_ = (*strings.Reader)(nil)
|
|
_ = net.IPv4len
|
|
_ = time.Duration(0)
|
|
_ = (*url.URL)(nil)
|
|
_ = (*mail.Address)(nil)
|
|
_ = anypb.Any{}
|
|
_ = sort.Sort
|
|
)
|
|
|
|
// Validate checks the field values on Package with the rules defined in the
|
|
// proto definition for this message. If any rules are violated, the first
|
|
// error encountered is returned, or nil if there are no violations.
|
|
func (m *Package) Validate() error {
|
|
return m.validate(false)
|
|
}
|
|
|
|
// ValidateAll checks the field values on Package with the rules defined in the
|
|
// proto definition for this message. If any rules are violated, the result is
|
|
// a list of violation errors wrapped in PackageMultiError, or nil if none found.
|
|
func (m *Package) ValidateAll() error {
|
|
return m.validate(true)
|
|
}
|
|
|
|
func (m *Package) validate(all bool) error {
|
|
if m == nil {
|
|
return nil
|
|
}
|
|
|
|
var errors []error
|
|
|
|
if m.GetId() <= 0 {
|
|
err := PackageValidationError{
|
|
field: "Id",
|
|
reason: "value must be greater than 0",
|
|
}
|
|
if !all {
|
|
return err
|
|
}
|
|
errors = append(errors, err)
|
|
}
|
|
|
|
if utf8.RuneCountInString(m.GetName()) < 1 {
|
|
err := PackageValidationError{
|
|
field: "Name",
|
|
reason: "value length must be at least 1 runes",
|
|
}
|
|
if !all {
|
|
return err
|
|
}
|
|
errors = append(errors, err)
|
|
}
|
|
|
|
if utf8.RuneCountInString(m.GetUrl()) < 1 {
|
|
err := PackageValidationError{
|
|
field: "Url",
|
|
reason: "value length must be at least 1 runes",
|
|
}
|
|
if !all {
|
|
return err
|
|
}
|
|
errors = append(errors, err)
|
|
}
|
|
|
|
for idx, item := range m.GetModules() {
|
|
_, _ = idx, item
|
|
|
|
if all {
|
|
switch v := interface{}(item).(type) {
|
|
case interface{ ValidateAll() error }:
|
|
if err := v.ValidateAll(); err != nil {
|
|
errors = append(errors, PackageValidationError{
|
|
field: fmt.Sprintf("Modules[%v]", idx),
|
|
reason: "embedded message failed validation",
|
|
cause: err,
|
|
})
|
|
}
|
|
case interface{ Validate() error }:
|
|
if err := v.Validate(); err != nil {
|
|
errors = append(errors, PackageValidationError{
|
|
field: fmt.Sprintf("Modules[%v]", idx),
|
|
reason: "embedded message failed validation",
|
|
cause: err,
|
|
})
|
|
}
|
|
}
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
|
|
if err := v.Validate(); err != nil {
|
|
return PackageValidationError{
|
|
field: fmt.Sprintf("Modules[%v]", idx),
|
|
reason: "embedded message failed validation",
|
|
cause: err,
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
for idx, item := range m.GetIssues() {
|
|
_, _ = idx, item
|
|
|
|
if all {
|
|
switch v := interface{}(item).(type) {
|
|
case interface{ ValidateAll() error }:
|
|
if err := v.ValidateAll(); err != nil {
|
|
errors = append(errors, PackageValidationError{
|
|
field: fmt.Sprintf("Issues[%v]", idx),
|
|
reason: "embedded message failed validation",
|
|
cause: err,
|
|
})
|
|
}
|
|
case interface{ Validate() error }:
|
|
if err := v.Validate(); err != nil {
|
|
errors = append(errors, PackageValidationError{
|
|
field: fmt.Sprintf("Issues[%v]", idx),
|
|
reason: "embedded message failed validation",
|
|
cause: err,
|
|
})
|
|
}
|
|
}
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
|
|
if err := v.Validate(); err != nil {
|
|
return PackageValidationError{
|
|
field: fmt.Sprintf("Issues[%v]", idx),
|
|
reason: "embedded message failed validation",
|
|
cause: err,
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
if len(errors) > 0 {
|
|
return PackageMultiError(errors)
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// PackageMultiError is an error wrapping multiple validation errors returned
|
|
// by Package.ValidateAll() if the designated constraints aren't met.
|
|
type PackageMultiError []error
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
|
func (m PackageMultiError) Error() string {
|
|
var msgs []string
|
|
for _, err := range m {
|
|
msgs = append(msgs, err.Error())
|
|
}
|
|
return strings.Join(msgs, "; ")
|
|
}
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
|
func (m PackageMultiError) AllErrors() []error { return m }
|
|
|
|
// PackageValidationError is the validation error returned by Package.Validate
|
|
// if the designated constraints aren't met.
|
|
type PackageValidationError struct {
|
|
field string
|
|
reason string
|
|
cause error
|
|
key bool
|
|
}
|
|
|
|
// Field function returns field value.
|
|
func (e PackageValidationError) Field() string { return e.field }
|
|
|
|
// Reason function returns reason value.
|
|
func (e PackageValidationError) Reason() string { return e.reason }
|
|
|
|
// Cause function returns cause value.
|
|
func (e PackageValidationError) Cause() error { return e.cause }
|
|
|
|
// Key function returns key value.
|
|
func (e PackageValidationError) Key() bool { return e.key }
|
|
|
|
// ErrorName returns error name.
|
|
func (e PackageValidationError) ErrorName() string { return "PackageValidationError" }
|
|
|
|
// Error satisfies the builtin error interface
|
|
func (e PackageValidationError) Error() string {
|
|
cause := ""
|
|
if e.cause != nil {
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
|
}
|
|
|
|
key := ""
|
|
if e.key {
|
|
key = "key for "
|
|
}
|
|
|
|
return fmt.Sprintf(
|
|
"invalid %sPackage.%s: %s%s",
|
|
key,
|
|
e.field,
|
|
e.reason,
|
|
cause)
|
|
}
|
|
|
|
var _ error = PackageValidationError{}
|
|
|
|
var _ interface {
|
|
Field() string
|
|
Reason() string
|
|
Key() bool
|
|
Cause() error
|
|
ErrorName() string
|
|
} = PackageValidationError{}
|
|
|
|
// Validate checks the field values on Module with the rules defined in the
|
|
// proto definition for this message. If any rules are violated, the first
|
|
// error encountered is returned, or nil if there are no violations.
|
|
func (m *Module) Validate() error {
|
|
return m.validate(false)
|
|
}
|
|
|
|
// ValidateAll checks the field values on Module with the rules defined in the
|
|
// proto definition for this message. If any rules are violated, the result is
|
|
// a list of violation errors wrapped in ModuleMultiError, or nil if none found.
|
|
func (m *Module) ValidateAll() error {
|
|
return m.validate(true)
|
|
}
|
|
|
|
func (m *Module) validate(all bool) error {
|
|
if m == nil {
|
|
return nil
|
|
}
|
|
|
|
var errors []error
|
|
|
|
if m.GetId() <= 0 {
|
|
err := ModuleValidationError{
|
|
field: "Id",
|
|
reason: "value must be greater than 0",
|
|
}
|
|
if !all {
|
|
return err
|
|
}
|
|
errors = append(errors, err)
|
|
}
|
|
|
|
if utf8.RuneCountInString(m.GetName()) < 1 {
|
|
err := ModuleValidationError{
|
|
field: "Name",
|
|
reason: "value length must be at least 1 runes",
|
|
}
|
|
if !all {
|
|
return err
|
|
}
|
|
errors = append(errors, err)
|
|
}
|
|
|
|
if utf8.RuneCountInString(m.GetVersion()) < 1 {
|
|
err := ModuleValidationError{
|
|
field: "Version",
|
|
reason: "value length must be at least 1 runes",
|
|
}
|
|
if !all {
|
|
return err
|
|
}
|
|
errors = append(errors, err)
|
|
}
|
|
|
|
if m.GetPackage() <= 0 {
|
|
err := ModuleValidationError{
|
|
field: "Package",
|
|
reason: "value must be greater than 0",
|
|
}
|
|
if !all {
|
|
return err
|
|
}
|
|
errors = append(errors, err)
|
|
}
|
|
|
|
if len(errors) > 0 {
|
|
return ModuleMultiError(errors)
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// ModuleMultiError is an error wrapping multiple validation errors returned by
|
|
// Module.ValidateAll() if the designated constraints aren't met.
|
|
type ModuleMultiError []error
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
|
func (m ModuleMultiError) Error() string {
|
|
var msgs []string
|
|
for _, err := range m {
|
|
msgs = append(msgs, err.Error())
|
|
}
|
|
return strings.Join(msgs, "; ")
|
|
}
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
|
func (m ModuleMultiError) AllErrors() []error { return m }
|
|
|
|
// ModuleValidationError is the validation error returned by Module.Validate if
|
|
// the designated constraints aren't met.
|
|
type ModuleValidationError struct {
|
|
field string
|
|
reason string
|
|
cause error
|
|
key bool
|
|
}
|
|
|
|
// Field function returns field value.
|
|
func (e ModuleValidationError) Field() string { return e.field }
|
|
|
|
// Reason function returns reason value.
|
|
func (e ModuleValidationError) Reason() string { return e.reason }
|
|
|
|
// Cause function returns cause value.
|
|
func (e ModuleValidationError) Cause() error { return e.cause }
|
|
|
|
// Key function returns key value.
|
|
func (e ModuleValidationError) Key() bool { return e.key }
|
|
|
|
// ErrorName returns error name.
|
|
func (e ModuleValidationError) ErrorName() string { return "ModuleValidationError" }
|
|
|
|
// Error satisfies the builtin error interface
|
|
func (e ModuleValidationError) Error() string {
|
|
cause := ""
|
|
if e.cause != nil {
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
|
}
|
|
|
|
key := ""
|
|
if e.key {
|
|
key = "key for "
|
|
}
|
|
|
|
return fmt.Sprintf(
|
|
"invalid %sModule.%s: %s%s",
|
|
key,
|
|
e.field,
|
|
e.reason,
|
|
cause)
|
|
}
|
|
|
|
var _ error = ModuleValidationError{}
|
|
|
|
var _ interface {
|
|
Field() string
|
|
Reason() string
|
|
Key() bool
|
|
Cause() error
|
|
ErrorName() string
|
|
} = ModuleValidationError{}
|
|
|
|
// Validate checks the field values on Issue with the rules defined in the
|
|
// proto definition for this message. If any rules are violated, the first
|
|
// error encountered is returned, or nil if there are no violations.
|
|
func (m *Issue) Validate() error {
|
|
return m.validate(false)
|
|
}
|
|
|
|
// ValidateAll checks the field values on Issue with the rules defined in the
|
|
// proto definition for this message. If any rules are violated, the result is
|
|
// a list of violation errors wrapped in IssueMultiError, or nil if none found.
|
|
func (m *Issue) ValidateAll() error {
|
|
return m.validate(true)
|
|
}
|
|
|
|
func (m *Issue) validate(all bool) error {
|
|
if m == nil {
|
|
return nil
|
|
}
|
|
|
|
var errors []error
|
|
|
|
if m.GetId() <= 0 {
|
|
err := IssueValidationError{
|
|
field: "Id",
|
|
reason: "value must be greater than 0",
|
|
}
|
|
if !all {
|
|
return err
|
|
}
|
|
errors = append(errors, err)
|
|
}
|
|
|
|
if m.GetStatus() <= 0 {
|
|
err := IssueValidationError{
|
|
field: "Status",
|
|
reason: "value must be greater than 0",
|
|
}
|
|
if !all {
|
|
return err
|
|
}
|
|
errors = append(errors, err)
|
|
}
|
|
|
|
if utf8.RuneCountInString(m.GetDesc()) < 1 {
|
|
err := IssueValidationError{
|
|
field: "Desc",
|
|
reason: "value length must be at least 1 runes",
|
|
}
|
|
if !all {
|
|
return err
|
|
}
|
|
errors = append(errors, err)
|
|
}
|
|
|
|
if m.GetPackage() <= 0 {
|
|
err := IssueValidationError{
|
|
field: "Package",
|
|
reason: "value must be greater than 0",
|
|
}
|
|
if !all {
|
|
return err
|
|
}
|
|
errors = append(errors, err)
|
|
}
|
|
|
|
if len(errors) > 0 {
|
|
return IssueMultiError(errors)
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// IssueMultiError is an error wrapping multiple validation errors returned by
|
|
// Issue.ValidateAll() if the designated constraints aren't met.
|
|
type IssueMultiError []error
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
|
func (m IssueMultiError) Error() string {
|
|
var msgs []string
|
|
for _, err := range m {
|
|
msgs = append(msgs, err.Error())
|
|
}
|
|
return strings.Join(msgs, "; ")
|
|
}
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
|
func (m IssueMultiError) AllErrors() []error { return m }
|
|
|
|
// IssueValidationError is the validation error returned by Issue.Validate if
|
|
// the designated constraints aren't met.
|
|
type IssueValidationError struct {
|
|
field string
|
|
reason string
|
|
cause error
|
|
key bool
|
|
}
|
|
|
|
// Field function returns field value.
|
|
func (e IssueValidationError) Field() string { return e.field }
|
|
|
|
// Reason function returns reason value.
|
|
func (e IssueValidationError) Reason() string { return e.reason }
|
|
|
|
// Cause function returns cause value.
|
|
func (e IssueValidationError) Cause() error { return e.cause }
|
|
|
|
// Key function returns key value.
|
|
func (e IssueValidationError) Key() bool { return e.key }
|
|
|
|
// ErrorName returns error name.
|
|
func (e IssueValidationError) ErrorName() string { return "IssueValidationError" }
|
|
|
|
// Error satisfies the builtin error interface
|
|
func (e IssueValidationError) Error() string {
|
|
cause := ""
|
|
if e.cause != nil {
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
|
}
|
|
|
|
key := ""
|
|
if e.key {
|
|
key = "key for "
|
|
}
|
|
|
|
return fmt.Sprintf(
|
|
"invalid %sIssue.%s: %s%s",
|
|
key,
|
|
e.field,
|
|
e.reason,
|
|
cause)
|
|
}
|
|
|
|
var _ error = IssueValidationError{}
|
|
|
|
var _ interface {
|
|
Field() string
|
|
Reason() string
|
|
Key() bool
|
|
Cause() error
|
|
ErrorName() string
|
|
} = IssueValidationError{}
|
|
|
|
// Validate checks the field values on Comment with the rules defined in the
|
|
// proto definition for this message. If any rules are violated, the first
|
|
// error encountered is returned, or nil if there are no violations.
|
|
func (m *Comment) Validate() error {
|
|
return m.validate(false)
|
|
}
|
|
|
|
// ValidateAll checks the field values on Comment with the rules defined in the
|
|
// proto definition for this message. If any rules are violated, the result is
|
|
// a list of violation errors wrapped in CommentMultiError, or nil if none found.
|
|
func (m *Comment) ValidateAll() error {
|
|
return m.validate(true)
|
|
}
|
|
|
|
func (m *Comment) validate(all bool) error {
|
|
if m == nil {
|
|
return nil
|
|
}
|
|
|
|
var errors []error
|
|
|
|
if m.GetId() <= 0 {
|
|
err := CommentValidationError{
|
|
field: "Id",
|
|
reason: "value must be greater than 0",
|
|
}
|
|
if !all {
|
|
return err
|
|
}
|
|
errors = append(errors, err)
|
|
}
|
|
|
|
if m.GetPackage() <= 0 {
|
|
err := CommentValidationError{
|
|
field: "Package",
|
|
reason: "value must be greater than 0",
|
|
}
|
|
if !all {
|
|
return err
|
|
}
|
|
errors = append(errors, err)
|
|
}
|
|
|
|
// no validation rules for Text
|
|
|
|
if m.GetCreated() <= 0 {
|
|
err := CommentValidationError{
|
|
field: "Created",
|
|
reason: "value must be greater than 0",
|
|
}
|
|
if !all {
|
|
return err
|
|
}
|
|
errors = append(errors, err)
|
|
}
|
|
|
|
if m.GetUpdated() <= 0 {
|
|
err := CommentValidationError{
|
|
field: "Updated",
|
|
reason: "value must be greater than 0",
|
|
}
|
|
if !all {
|
|
return err
|
|
}
|
|
errors = append(errors, err)
|
|
}
|
|
|
|
if len(errors) > 0 {
|
|
return CommentMultiError(errors)
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// CommentMultiError is an error wrapping multiple validation errors returned
|
|
// by Comment.ValidateAll() if the designated constraints aren't met.
|
|
type CommentMultiError []error
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
|
func (m CommentMultiError) Error() string {
|
|
var msgs []string
|
|
for _, err := range m {
|
|
msgs = append(msgs, err.Error())
|
|
}
|
|
return strings.Join(msgs, "; ")
|
|
}
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
|
func (m CommentMultiError) AllErrors() []error { return m }
|
|
|
|
// CommentValidationError is the validation error returned by Comment.Validate
|
|
// if the designated constraints aren't met.
|
|
type CommentValidationError struct {
|
|
field string
|
|
reason string
|
|
cause error
|
|
key bool
|
|
}
|
|
|
|
// Field function returns field value.
|
|
func (e CommentValidationError) Field() string { return e.field }
|
|
|
|
// Reason function returns reason value.
|
|
func (e CommentValidationError) Reason() string { return e.reason }
|
|
|
|
// Cause function returns cause value.
|
|
func (e CommentValidationError) Cause() error { return e.cause }
|
|
|
|
// Key function returns key value.
|
|
func (e CommentValidationError) Key() bool { return e.key }
|
|
|
|
// ErrorName returns error name.
|
|
func (e CommentValidationError) ErrorName() string { return "CommentValidationError" }
|
|
|
|
// Error satisfies the builtin error interface
|
|
func (e CommentValidationError) Error() string {
|
|
cause := ""
|
|
if e.cause != nil {
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
|
}
|
|
|
|
key := ""
|
|
if e.key {
|
|
key = "key for "
|
|
}
|
|
|
|
return fmt.Sprintf(
|
|
"invalid %sComment.%s: %s%s",
|
|
key,
|
|
e.field,
|
|
e.reason,
|
|
cause)
|
|
}
|
|
|
|
var _ error = CommentValidationError{}
|
|
|
|
var _ interface {
|
|
Field() string
|
|
Reason() string
|
|
Key() bool
|
|
Cause() error
|
|
ErrorName() string
|
|
} = CommentValidationError{}
|
|
|
|
// Validate checks the field values on ListPackageReq with the rules defined in
|
|
// the proto definition for this message. If any rules are violated, the first
|
|
// error encountered is returned, or nil if there are no violations.
|
|
func (m *ListPackageReq) Validate() error {
|
|
return m.validate(false)
|
|
}
|
|
|
|
// ValidateAll checks the field values on ListPackageReq with the rules defined
|
|
// in the proto definition for this message. If any rules are violated, the
|
|
// result is a list of violation errors wrapped in ListPackageReqMultiError,
|
|
// or nil if none found.
|
|
func (m *ListPackageReq) ValidateAll() error {
|
|
return m.validate(true)
|
|
}
|
|
|
|
func (m *ListPackageReq) validate(all bool) error {
|
|
if m == nil {
|
|
return nil
|
|
}
|
|
|
|
var errors []error
|
|
|
|
if len(errors) > 0 {
|
|
return ListPackageReqMultiError(errors)
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// ListPackageReqMultiError is an error wrapping multiple validation errors
|
|
// returned by ListPackageReq.ValidateAll() if the designated constraints
|
|
// aren't met.
|
|
type ListPackageReqMultiError []error
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
|
func (m ListPackageReqMultiError) Error() string {
|
|
var msgs []string
|
|
for _, err := range m {
|
|
msgs = append(msgs, err.Error())
|
|
}
|
|
return strings.Join(msgs, "; ")
|
|
}
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
|
func (m ListPackageReqMultiError) AllErrors() []error { return m }
|
|
|
|
// ListPackageReqValidationError is the validation error returned by
|
|
// ListPackageReq.Validate if the designated constraints aren't met.
|
|
type ListPackageReqValidationError struct {
|
|
field string
|
|
reason string
|
|
cause error
|
|
key bool
|
|
}
|
|
|
|
// Field function returns field value.
|
|
func (e ListPackageReqValidationError) Field() string { return e.field }
|
|
|
|
// Reason function returns reason value.
|
|
func (e ListPackageReqValidationError) Reason() string { return e.reason }
|
|
|
|
// Cause function returns cause value.
|
|
func (e ListPackageReqValidationError) Cause() error { return e.cause }
|
|
|
|
// Key function returns key value.
|
|
func (e ListPackageReqValidationError) Key() bool { return e.key }
|
|
|
|
// ErrorName returns error name.
|
|
func (e ListPackageReqValidationError) ErrorName() string { return "ListPackageReqValidationError" }
|
|
|
|
// Error satisfies the builtin error interface
|
|
func (e ListPackageReqValidationError) Error() string {
|
|
cause := ""
|
|
if e.cause != nil {
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
|
}
|
|
|
|
key := ""
|
|
if e.key {
|
|
key = "key for "
|
|
}
|
|
|
|
return fmt.Sprintf(
|
|
"invalid %sListPackageReq.%s: %s%s",
|
|
key,
|
|
e.field,
|
|
e.reason,
|
|
cause)
|
|
}
|
|
|
|
var _ error = ListPackageReqValidationError{}
|
|
|
|
var _ interface {
|
|
Field() string
|
|
Reason() string
|
|
Key() bool
|
|
Cause() error
|
|
ErrorName() string
|
|
} = ListPackageReqValidationError{}
|
|
|
|
// Validate checks the field values on ListPackageRsp with the rules defined in
|
|
// the proto definition for this message. If any rules are violated, the first
|
|
// error encountered is returned, or nil if there are no violations.
|
|
func (m *ListPackageRsp) Validate() error {
|
|
return m.validate(false)
|
|
}
|
|
|
|
// ValidateAll checks the field values on ListPackageRsp with the rules defined
|
|
// in the proto definition for this message. If any rules are violated, the
|
|
// result is a list of violation errors wrapped in ListPackageRspMultiError,
|
|
// or nil if none found.
|
|
func (m *ListPackageRsp) ValidateAll() error {
|
|
return m.validate(true)
|
|
}
|
|
|
|
func (m *ListPackageRsp) validate(all bool) error {
|
|
if m == nil {
|
|
return nil
|
|
}
|
|
|
|
var errors []error
|
|
|
|
for idx, item := range m.GetPackages() {
|
|
_, _ = idx, item
|
|
|
|
if all {
|
|
switch v := interface{}(item).(type) {
|
|
case interface{ ValidateAll() error }:
|
|
if err := v.ValidateAll(); err != nil {
|
|
errors = append(errors, ListPackageRspValidationError{
|
|
field: fmt.Sprintf("Packages[%v]", idx),
|
|
reason: "embedded message failed validation",
|
|
cause: err,
|
|
})
|
|
}
|
|
case interface{ Validate() error }:
|
|
if err := v.Validate(); err != nil {
|
|
errors = append(errors, ListPackageRspValidationError{
|
|
field: fmt.Sprintf("Packages[%v]", idx),
|
|
reason: "embedded message failed validation",
|
|
cause: err,
|
|
})
|
|
}
|
|
}
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
|
|
if err := v.Validate(); err != nil {
|
|
return ListPackageRspValidationError{
|
|
field: fmt.Sprintf("Packages[%v]", idx),
|
|
reason: "embedded message failed validation",
|
|
cause: err,
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
if len(errors) > 0 {
|
|
return ListPackageRspMultiError(errors)
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// ListPackageRspMultiError is an error wrapping multiple validation errors
|
|
// returned by ListPackageRsp.ValidateAll() if the designated constraints
|
|
// aren't met.
|
|
type ListPackageRspMultiError []error
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
|
func (m ListPackageRspMultiError) Error() string {
|
|
var msgs []string
|
|
for _, err := range m {
|
|
msgs = append(msgs, err.Error())
|
|
}
|
|
return strings.Join(msgs, "; ")
|
|
}
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
|
func (m ListPackageRspMultiError) AllErrors() []error { return m }
|
|
|
|
// ListPackageRspValidationError is the validation error returned by
|
|
// ListPackageRsp.Validate if the designated constraints aren't met.
|
|
type ListPackageRspValidationError struct {
|
|
field string
|
|
reason string
|
|
cause error
|
|
key bool
|
|
}
|
|
|
|
// Field function returns field value.
|
|
func (e ListPackageRspValidationError) Field() string { return e.field }
|
|
|
|
// Reason function returns reason value.
|
|
func (e ListPackageRspValidationError) Reason() string { return e.reason }
|
|
|
|
// Cause function returns cause value.
|
|
func (e ListPackageRspValidationError) Cause() error { return e.cause }
|
|
|
|
// Key function returns key value.
|
|
func (e ListPackageRspValidationError) Key() bool { return e.key }
|
|
|
|
// ErrorName returns error name.
|
|
func (e ListPackageRspValidationError) ErrorName() string { return "ListPackageRspValidationError" }
|
|
|
|
// Error satisfies the builtin error interface
|
|
func (e ListPackageRspValidationError) Error() string {
|
|
cause := ""
|
|
if e.cause != nil {
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
|
}
|
|
|
|
key := ""
|
|
if e.key {
|
|
key = "key for "
|
|
}
|
|
|
|
return fmt.Sprintf(
|
|
"invalid %sListPackageRsp.%s: %s%s",
|
|
key,
|
|
e.field,
|
|
e.reason,
|
|
cause)
|
|
}
|
|
|
|
var _ error = ListPackageRspValidationError{}
|
|
|
|
var _ interface {
|
|
Field() string
|
|
Reason() string
|
|
Key() bool
|
|
Cause() error
|
|
ErrorName() string
|
|
} = ListPackageRspValidationError{}
|
|
|
|
// Validate checks the field values on UpdateInfoPackageRsp with the rules
|
|
// defined in the proto definition for this message. If any rules are
|
|
// violated, the first error encountered is returned, or nil if there are no violations.
|
|
func (m *UpdateInfoPackageRsp) Validate() error {
|
|
return m.validate(false)
|
|
}
|
|
|
|
// ValidateAll checks the field values on UpdateInfoPackageRsp with the rules
|
|
// defined in the proto definition for this message. If any rules are
|
|
// violated, the result is a list of violation errors wrapped in
|
|
// UpdateInfoPackageRspMultiError, or nil if none found.
|
|
func (m *UpdateInfoPackageRsp) ValidateAll() error {
|
|
return m.validate(true)
|
|
}
|
|
|
|
func (m *UpdateInfoPackageRsp) validate(all bool) error {
|
|
if m == nil {
|
|
return nil
|
|
}
|
|
|
|
var errors []error
|
|
|
|
if m.GetId() <= 0 {
|
|
err := UpdateInfoPackageRspValidationError{
|
|
field: "Id",
|
|
reason: "value must be greater than 0",
|
|
}
|
|
if !all {
|
|
return err
|
|
}
|
|
errors = append(errors, err)
|
|
}
|
|
|
|
if len(errors) > 0 {
|
|
return UpdateInfoPackageRspMultiError(errors)
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// UpdateInfoPackageRspMultiError is an error wrapping multiple validation
|
|
// errors returned by UpdateInfoPackageRsp.ValidateAll() if the designated
|
|
// constraints aren't met.
|
|
type UpdateInfoPackageRspMultiError []error
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
|
func (m UpdateInfoPackageRspMultiError) Error() string {
|
|
var msgs []string
|
|
for _, err := range m {
|
|
msgs = append(msgs, err.Error())
|
|
}
|
|
return strings.Join(msgs, "; ")
|
|
}
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
|
func (m UpdateInfoPackageRspMultiError) AllErrors() []error { return m }
|
|
|
|
// UpdateInfoPackageRspValidationError is the validation error returned by
|
|
// UpdateInfoPackageRsp.Validate if the designated constraints aren't met.
|
|
type UpdateInfoPackageRspValidationError struct {
|
|
field string
|
|
reason string
|
|
cause error
|
|
key bool
|
|
}
|
|
|
|
// Field function returns field value.
|
|
func (e UpdateInfoPackageRspValidationError) Field() string { return e.field }
|
|
|
|
// Reason function returns reason value.
|
|
func (e UpdateInfoPackageRspValidationError) Reason() string { return e.reason }
|
|
|
|
// Cause function returns cause value.
|
|
func (e UpdateInfoPackageRspValidationError) Cause() error { return e.cause }
|
|
|
|
// Key function returns key value.
|
|
func (e UpdateInfoPackageRspValidationError) Key() bool { return e.key }
|
|
|
|
// ErrorName returns error name.
|
|
func (e UpdateInfoPackageRspValidationError) ErrorName() string {
|
|
return "UpdateInfoPackageRspValidationError"
|
|
}
|
|
|
|
// Error satisfies the builtin error interface
|
|
func (e UpdateInfoPackageRspValidationError) Error() string {
|
|
cause := ""
|
|
if e.cause != nil {
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
|
}
|
|
|
|
key := ""
|
|
if e.key {
|
|
key = "key for "
|
|
}
|
|
|
|
return fmt.Sprintf(
|
|
"invalid %sUpdateInfoPackageRsp.%s: %s%s",
|
|
key,
|
|
e.field,
|
|
e.reason,
|
|
cause)
|
|
}
|
|
|
|
var _ error = UpdateInfoPackageRspValidationError{}
|
|
|
|
var _ interface {
|
|
Field() string
|
|
Reason() string
|
|
Key() bool
|
|
Cause() error
|
|
ErrorName() string
|
|
} = UpdateInfoPackageRspValidationError{}
|
|
|
|
// Validate checks the field values on UpdateInfoPackageReq with the rules
|
|
// defined in the proto definition for this message. If any rules are
|
|
// violated, the first error encountered is returned, or nil if there are no violations.
|
|
func (m *UpdateInfoPackageReq) Validate() error {
|
|
return m.validate(false)
|
|
}
|
|
|
|
// ValidateAll checks the field values on UpdateInfoPackageReq with the rules
|
|
// defined in the proto definition for this message. If any rules are
|
|
// violated, the result is a list of violation errors wrapped in
|
|
// UpdateInfoPackageReqMultiError, or nil if none found.
|
|
func (m *UpdateInfoPackageReq) ValidateAll() error {
|
|
return m.validate(true)
|
|
}
|
|
|
|
func (m *UpdateInfoPackageReq) validate(all bool) error {
|
|
if m == nil {
|
|
return nil
|
|
}
|
|
|
|
var errors []error
|
|
|
|
if m.GetId() <= 0 {
|
|
err := UpdateInfoPackageReqValidationError{
|
|
field: "Id",
|
|
reason: "value must be greater than 0",
|
|
}
|
|
if !all {
|
|
return err
|
|
}
|
|
errors = append(errors, err)
|
|
}
|
|
|
|
if len(errors) > 0 {
|
|
return UpdateInfoPackageReqMultiError(errors)
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// UpdateInfoPackageReqMultiError is an error wrapping multiple validation
|
|
// errors returned by UpdateInfoPackageReq.ValidateAll() if the designated
|
|
// constraints aren't met.
|
|
type UpdateInfoPackageReqMultiError []error
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
|
func (m UpdateInfoPackageReqMultiError) Error() string {
|
|
var msgs []string
|
|
for _, err := range m {
|
|
msgs = append(msgs, err.Error())
|
|
}
|
|
return strings.Join(msgs, "; ")
|
|
}
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
|
func (m UpdateInfoPackageReqMultiError) AllErrors() []error { return m }
|
|
|
|
// UpdateInfoPackageReqValidationError is the validation error returned by
|
|
// UpdateInfoPackageReq.Validate if the designated constraints aren't met.
|
|
type UpdateInfoPackageReqValidationError struct {
|
|
field string
|
|
reason string
|
|
cause error
|
|
key bool
|
|
}
|
|
|
|
// Field function returns field value.
|
|
func (e UpdateInfoPackageReqValidationError) Field() string { return e.field }
|
|
|
|
// Reason function returns reason value.
|
|
func (e UpdateInfoPackageReqValidationError) Reason() string { return e.reason }
|
|
|
|
// Cause function returns cause value.
|
|
func (e UpdateInfoPackageReqValidationError) Cause() error { return e.cause }
|
|
|
|
// Key function returns key value.
|
|
func (e UpdateInfoPackageReqValidationError) Key() bool { return e.key }
|
|
|
|
// ErrorName returns error name.
|
|
func (e UpdateInfoPackageReqValidationError) ErrorName() string {
|
|
return "UpdateInfoPackageReqValidationError"
|
|
}
|
|
|
|
// Error satisfies the builtin error interface
|
|
func (e UpdateInfoPackageReqValidationError) Error() string {
|
|
cause := ""
|
|
if e.cause != nil {
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
|
}
|
|
|
|
key := ""
|
|
if e.key {
|
|
key = "key for "
|
|
}
|
|
|
|
return fmt.Sprintf(
|
|
"invalid %sUpdateInfoPackageReq.%s: %s%s",
|
|
key,
|
|
e.field,
|
|
e.reason,
|
|
cause)
|
|
}
|
|
|
|
var _ error = UpdateInfoPackageReqValidationError{}
|
|
|
|
var _ interface {
|
|
Field() string
|
|
Reason() string
|
|
Key() bool
|
|
Cause() error
|
|
ErrorName() string
|
|
} = UpdateInfoPackageReqValidationError{}
|
|
|
|
// Validate checks the field values on CommentRsp with the rules defined in the
|
|
// proto definition for this message. If any rules are violated, the first
|
|
// error encountered is returned, or nil if there are no violations.
|
|
func (m *CommentRsp) Validate() error {
|
|
return m.validate(false)
|
|
}
|
|
|
|
// ValidateAll checks the field values on CommentRsp with the rules defined in
|
|
// the proto definition for this message. If any rules are violated, the
|
|
// result is a list of violation errors wrapped in CommentRspMultiError, or
|
|
// nil if none found.
|
|
func (m *CommentRsp) ValidateAll() error {
|
|
return m.validate(true)
|
|
}
|
|
|
|
func (m *CommentRsp) validate(all bool) error {
|
|
if m == nil {
|
|
return nil
|
|
}
|
|
|
|
var errors []error
|
|
|
|
if m.GetIdPackage() <= 0 {
|
|
err := CommentRspValidationError{
|
|
field: "IdPackage",
|
|
reason: "value must be greater than 0",
|
|
}
|
|
if !all {
|
|
return err
|
|
}
|
|
errors = append(errors, err)
|
|
}
|
|
|
|
// no validation rules for Text
|
|
|
|
if len(errors) > 0 {
|
|
return CommentRspMultiError(errors)
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// CommentRspMultiError is an error wrapping multiple validation errors
|
|
// returned by CommentRsp.ValidateAll() if the designated constraints aren't met.
|
|
type CommentRspMultiError []error
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
|
func (m CommentRspMultiError) Error() string {
|
|
var msgs []string
|
|
for _, err := range m {
|
|
msgs = append(msgs, err.Error())
|
|
}
|
|
return strings.Join(msgs, "; ")
|
|
}
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
|
func (m CommentRspMultiError) AllErrors() []error { return m }
|
|
|
|
// CommentRspValidationError is the validation error returned by
|
|
// CommentRsp.Validate if the designated constraints aren't met.
|
|
type CommentRspValidationError struct {
|
|
field string
|
|
reason string
|
|
cause error
|
|
key bool
|
|
}
|
|
|
|
// Field function returns field value.
|
|
func (e CommentRspValidationError) Field() string { return e.field }
|
|
|
|
// Reason function returns reason value.
|
|
func (e CommentRspValidationError) Reason() string { return e.reason }
|
|
|
|
// Cause function returns cause value.
|
|
func (e CommentRspValidationError) Cause() error { return e.cause }
|
|
|
|
// Key function returns key value.
|
|
func (e CommentRspValidationError) Key() bool { return e.key }
|
|
|
|
// ErrorName returns error name.
|
|
func (e CommentRspValidationError) ErrorName() string { return "CommentRspValidationError" }
|
|
|
|
// Error satisfies the builtin error interface
|
|
func (e CommentRspValidationError) Error() string {
|
|
cause := ""
|
|
if e.cause != nil {
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
|
}
|
|
|
|
key := ""
|
|
if e.key {
|
|
key = "key for "
|
|
}
|
|
|
|
return fmt.Sprintf(
|
|
"invalid %sCommentRsp.%s: %s%s",
|
|
key,
|
|
e.field,
|
|
e.reason,
|
|
cause)
|
|
}
|
|
|
|
var _ error = CommentRspValidationError{}
|
|
|
|
var _ interface {
|
|
Field() string
|
|
Reason() string
|
|
Key() bool
|
|
Cause() error
|
|
ErrorName() string
|
|
} = CommentRspValidationError{}
|
|
|
|
// Validate checks the field values on CommentReq with the rules defined in the
|
|
// proto definition for this message. If any rules are violated, the first
|
|
// error encountered is returned, or nil if there are no violations.
|
|
func (m *CommentReq) Validate() error {
|
|
return m.validate(false)
|
|
}
|
|
|
|
// ValidateAll checks the field values on CommentReq with the rules defined in
|
|
// the proto definition for this message. If any rules are violated, the
|
|
// result is a list of violation errors wrapped in CommentReqMultiError, or
|
|
// nil if none found.
|
|
func (m *CommentReq) ValidateAll() error {
|
|
return m.validate(true)
|
|
}
|
|
|
|
func (m *CommentReq) validate(all bool) error {
|
|
if m == nil {
|
|
return nil
|
|
}
|
|
|
|
var errors []error
|
|
|
|
if m.GetId() <= 0 {
|
|
err := CommentReqValidationError{
|
|
field: "Id",
|
|
reason: "value must be greater than 0",
|
|
}
|
|
if !all {
|
|
return err
|
|
}
|
|
errors = append(errors, err)
|
|
}
|
|
|
|
if len(errors) > 0 {
|
|
return CommentReqMultiError(errors)
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// CommentReqMultiError is an error wrapping multiple validation errors
|
|
// returned by CommentReq.ValidateAll() if the designated constraints aren't met.
|
|
type CommentReqMultiError []error
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
|
func (m CommentReqMultiError) Error() string {
|
|
var msgs []string
|
|
for _, err := range m {
|
|
msgs = append(msgs, err.Error())
|
|
}
|
|
return strings.Join(msgs, "; ")
|
|
}
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
|
func (m CommentReqMultiError) AllErrors() []error { return m }
|
|
|
|
// CommentReqValidationError is the validation error returned by
|
|
// CommentReq.Validate if the designated constraints aren't met.
|
|
type CommentReqValidationError struct {
|
|
field string
|
|
reason string
|
|
cause error
|
|
key bool
|
|
}
|
|
|
|
// Field function returns field value.
|
|
func (e CommentReqValidationError) Field() string { return e.field }
|
|
|
|
// Reason function returns reason value.
|
|
func (e CommentReqValidationError) Reason() string { return e.reason }
|
|
|
|
// Cause function returns cause value.
|
|
func (e CommentReqValidationError) Cause() error { return e.cause }
|
|
|
|
// Key function returns key value.
|
|
func (e CommentReqValidationError) Key() bool { return e.key }
|
|
|
|
// ErrorName returns error name.
|
|
func (e CommentReqValidationError) ErrorName() string { return "CommentReqValidationError" }
|
|
|
|
// Error satisfies the builtin error interface
|
|
func (e CommentReqValidationError) Error() string {
|
|
cause := ""
|
|
if e.cause != nil {
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
|
}
|
|
|
|
key := ""
|
|
if e.key {
|
|
key = "key for "
|
|
}
|
|
|
|
return fmt.Sprintf(
|
|
"invalid %sCommentReq.%s: %s%s",
|
|
key,
|
|
e.field,
|
|
e.reason,
|
|
cause)
|
|
}
|
|
|
|
var _ error = CommentReqValidationError{}
|
|
|
|
var _ interface {
|
|
Field() string
|
|
Reason() string
|
|
Key() bool
|
|
Cause() error
|
|
ErrorName() string
|
|
} = CommentReqValidationError{}
|