github.com/s7techlab/cckit@v0.10.5/examples/token/service/config/config.validator.pb.go (about)

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: token/service/config/config.proto
     3  
     4  package config
     5  
     6  import (
     7  	fmt "fmt"
     8  	proto "github.com/golang/protobuf/proto"
     9  	_ "github.com/mwitkow/go-proto-validators"
    10  	github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
    11  	_ "google.golang.org/genproto/googleapis/api/annotations"
    12  	_ "google.golang.org/protobuf/types/known/emptypb"
    13  	math "math"
    14  )
    15  
    16  // Reference imports to suppress errors if they are not otherwise used.
    17  var _ = proto.Marshal
    18  var _ = fmt.Errorf
    19  var _ = math.Inf
    20  
    21  func (this *CreateTokenTypeRequest) Validate() error {
    22  	if this.Name == "" {
    23  		return github_com_mwitkow_go_proto_validators.FieldError("Name", fmt.Errorf(`value '%v' must not be an empty string`, this.Name))
    24  	}
    25  	if this.Symbol == "" {
    26  		return github_com_mwitkow_go_proto_validators.FieldError("Symbol", fmt.Errorf(`value '%v' must not be an empty string`, this.Symbol))
    27  	}
    28  	if !(this.Decimals < 9) {
    29  		return github_com_mwitkow_go_proto_validators.FieldError("Decimals", fmt.Errorf(`value '%v' must be less than '9'`, this.Decimals))
    30  	}
    31  	if _, ok := TokenGroupType_name[int32(this.GroupType)]; !ok {
    32  		return github_com_mwitkow_go_proto_validators.FieldError("GroupType", fmt.Errorf(`value '%v' must be a valid TokenGroupType field`, this.GroupType))
    33  	}
    34  	for _, item := range this.Meta {
    35  		if item != nil {
    36  			if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
    37  				return github_com_mwitkow_go_proto_validators.FieldError("Meta", err)
    38  			}
    39  		}
    40  	}
    41  	return nil
    42  }
    43  func (this *UpdateTokenTypeRequest) Validate() error {
    44  	if this.Name == "" {
    45  		return github_com_mwitkow_go_proto_validators.FieldError("Name", fmt.Errorf(`value '%v' must not be an empty string`, this.Name))
    46  	}
    47  	if this.Symbol == "" {
    48  		return github_com_mwitkow_go_proto_validators.FieldError("Symbol", fmt.Errorf(`value '%v' must not be an empty string`, this.Symbol))
    49  	}
    50  	for _, item := range this.Meta {
    51  		if item != nil {
    52  			if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
    53  				return github_com_mwitkow_go_proto_validators.FieldError("Meta", err)
    54  			}
    55  		}
    56  	}
    57  	return nil
    58  }
    59  func (this *CreateTokenGroupRequest) Validate() error {
    60  	if len(this.Name) < 1 {
    61  		return github_com_mwitkow_go_proto_validators.FieldError("Name", fmt.Errorf(`value '%v' must contain at least 1 elements`, this.Name))
    62  	}
    63  	if this.TokenType == "" {
    64  		return github_com_mwitkow_go_proto_validators.FieldError("TokenType", fmt.Errorf(`value '%v' must not be an empty string`, this.TokenType))
    65  	}
    66  	for _, item := range this.Meta {
    67  		if item != nil {
    68  			if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
    69  				return github_com_mwitkow_go_proto_validators.FieldError("Meta", err)
    70  			}
    71  		}
    72  	}
    73  	return nil
    74  }
    75  func (this *Config) Validate() error {
    76  	return nil
    77  }
    78  func (this *TokenId) Validate() error {
    79  	return nil
    80  }
    81  func (this *TokenTypeId) Validate() error {
    82  	return nil
    83  }
    84  func (this *TokenType) Validate() error {
    85  	for _, item := range this.Meta {
    86  		if item != nil {
    87  			if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
    88  				return github_com_mwitkow_go_proto_validators.FieldError("Meta", err)
    89  			}
    90  		}
    91  	}
    92  	return nil
    93  }
    94  func (this *TokenTypes) Validate() error {
    95  	for _, item := range this.Types {
    96  		if item != nil {
    97  			if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
    98  				return github_com_mwitkow_go_proto_validators.FieldError("Types", err)
    99  			}
   100  		}
   101  	}
   102  	return nil
   103  }
   104  func (this *TokenGroupId) Validate() error {
   105  	return nil
   106  }
   107  func (this *TokenGroup) Validate() error {
   108  	for _, item := range this.Meta {
   109  		if item != nil {
   110  			if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
   111  				return github_com_mwitkow_go_proto_validators.FieldError("Meta", err)
   112  			}
   113  		}
   114  	}
   115  	return nil
   116  }
   117  func (this *TokenGroups) Validate() error {
   118  	for _, item := range this.Groups {
   119  		if item != nil {
   120  			if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
   121  				return github_com_mwitkow_go_proto_validators.FieldError("Groups", err)
   122  			}
   123  		}
   124  	}
   125  	return nil
   126  }
   127  func (this *TokenMetaRequest) Validate() error {
   128  	if this.Key == "" {
   129  		return github_com_mwitkow_go_proto_validators.FieldError("Key", fmt.Errorf(`value '%v' must not be an empty string`, this.Key))
   130  	}
   131  	if this.Value == "" {
   132  		return github_com_mwitkow_go_proto_validators.FieldError("Value", fmt.Errorf(`value '%v' must not be an empty string`, this.Value))
   133  	}
   134  	return nil
   135  }
   136  func (this *TokenMeta) Validate() error {
   137  	return nil
   138  }
   139  func (this *Token) Validate() error {
   140  	if this.Type != nil {
   141  		if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Type); err != nil {
   142  			return github_com_mwitkow_go_proto_validators.FieldError("Type", err)
   143  		}
   144  	}
   145  	if this.Group != nil {
   146  		if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Group); err != nil {
   147  			return github_com_mwitkow_go_proto_validators.FieldError("Group", err)
   148  		}
   149  	}
   150  	return nil
   151  }
   152  func (this *TokenTypeCreated) Validate() error {
   153  	return nil
   154  }
   155  func (this *TokenGroupCreated) Validate() error {
   156  	return nil
   157  }