validator

package
v1.12.0-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Validator

type Validator struct {
	// contains filtered or unexported fields
}

func New

func New(db *db.DB, res *idresolver.Resolver, enforcer *rbac.Enforcer) *Validator

func (*Validator) ValidateIssue

func (v *Validator) ValidateIssue(issue *models.Issue) error

func (*Validator) ValidateIssueComment

func (v *Validator) ValidateIssueComment(comment *models.IssueComment) error

func (*Validator) ValidateLabelDefinition

func (v *Validator) ValidateLabelDefinition(label *models.LabelDefinition) error

func (*Validator) ValidateLabelOp

func (v *Validator) ValidateLabelOp(labelDef *models.LabelDefinition, repo *models.Repo, labelOp *models.LabelOp) error

func (*Validator) ValidatePatch

func (v *Validator) ValidatePatch(patch *string) error

func (*Validator) ValidateRepoTopicStr

func (v *Validator) ValidateRepoTopicStr(topicsStr string) ([]string, error)

ValidateRepoTopicStr parses and validates whitespace-separated topic string.

Rules:

  • topics are separated by whitespace
  • each topic may contain lowercase letters, digits, and hyphens only
  • each topic must be <= 50 characters long
  • no more than 20 topics allowed
  • duplicates are removed

func (*Validator) ValidateString

func (v *Validator) ValidateString(s *models.String) error

func (*Validator) ValidateURI

func (v *Validator) ValidateURI(uri string) error

Source Files

  • issue.go
  • label.go
  • patch.go
  • repo_topics.go
  • string.go
  • uri.go
  • validator.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL