domain

package
v0.0.0-...-8c7407d Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 2 Imported by: 3

Documentation

Index

Constants

View Source
const (
	ServerError = iota + 1
	ClientError
	ValidationError
)

Variables

This section is empty.

Functions

func NewAppError

func NewAppError(e error, c int) error

Types

type APIViolationsRequest

type APIViolationsRequest struct {
	APIDefinitionString string `json:"api_definition_string"`
}

APIViolationsRequest is a wrapper around API definition

type AppError

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

func (*AppError) Code

func (e *AppError) Code() int

func (*AppError) Error

func (e *AppError) Error() string

type Error

type Error interface {
	Code() int
}

type Rule

type Rule struct {
	Title    string `json:"title"`
	Code     string `json:"code"`
	Type     string `json:"type"`
	URL      string `json:"url"`
	IsActive bool   `json:"is_active"`
}

Rule keeps information about API rules

type Rules

type Rules struct {
	Rules []Rule `json:"rules"`
}

Rules stores list of rules

func (*Rules) Hint

func (r *Rules) Hint() []Rule

Hint returns hint rules

func (*Rules) May

func (r *Rules) May() []Rule

May returns may rules

func (*Rules) Must

func (r *Rules) Must() []Rule

Must returns must rules

func (*Rules) Should

func (r *Rules) Should() []Rule

Should returns should rules

type Violation

type Violation struct {
	Title         string   `json:"title"`
	Description   string   `json:"description"`
	ViolationType string   `json:"violation_type"`
	RuleLink      string   `json:"rule_link"`
	Pointer       string   `json:"pointer"`
	StartLine     int      `json:"start_line"`
	EndLine       int      `json:"end_line"`
	Paths         []string `json:"paths"`
}

Violation keeps information about Zally violations

func (*Violation) ToPointerDisplayString

func (v *Violation) ToPointerDisplayString() string

ToPointerDisplayString returns the pointer of the violation in user friendly display format

type Violations

type Violations struct {
	Violations      []Violation     `json:"violations"`
	ViolationsCount ViolationsCount `json:"violations_count"`
	Message         string          `json:"message"`
}

Violations stores api_violations response

func (*Violations) Hint

func (v *Violations) Hint() []Violation

Hint returns hint violations

func (*Violations) May

func (v *Violations) May() []Violation

May returns may violations

func (*Violations) Must

func (v *Violations) Must() []Violation

Must returns must violations

func (*Violations) Should

func (v *Violations) Should() []Violation

Should returns should violations

type ViolationsCount

type ViolationsCount struct {
	Must   int `json:"must"`
	Should int `json:"should"`
	May    int `json:"may"`
	Hint   int `json:"hint"`
}

ViolationsCount contains violation counters

Jump to

Keyboard shortcuts

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