jerr

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

View Source
const (
	RequiredParameterNotSpecified                       = "required parameter not specified"
	ParametersAreForbiddenForTheDirective               = "parameters are forbidden for the directive"
	AnnotationIsForbiddenForTheDirective                = "annotation is forbidden for the directive"
	EmptyDescription                                    = "empty description"
	EmptyBody                                           = "empty body"
	ResourceNotFound                                    = "resource not found"
	ResponsesIsEmpty                                    = "responses is empty"
	RequestIsEmpty                                      = "request is empty"
	NotUniqueDirective                                  = "not a unique directive"
	IncorrectParameter                                  = "incorrect parameter"
	BodyMustBeObject                                    = "body must be object"
	IsNotHTTPRequestMethod                              = "directive is not a HTTP request method"
	MethodNotFound                                      = "method not found"
	PathNotFound                                        = "path not found"
	IncorrectPath                                       = "incorrect path"
	CannotUseTheTypeAndSchemaNotationParametersTogether = "cannot use the Type and SchemaNotation parameters together"
	IncorrectContextOfDirective                         = "incorrect context of directive"
	ThereIsNoExplicitContextForClosure                  = "there is no explicit context for closure"
)

Variables

This section is empty.

Functions

func DetectNewLineSymbol

func DetectNewLineSymbol(content bytes.Bytes) byte

func GetQuote

func GetQuote(content bytes.Bytes, position bytes.Index, nl byte) string

GetQuote return "" if cannot determine the source sub-string

func LineBeginning

func LineBeginning(content bytes.Bytes, position bytes.Index, nl byte) bytes.Index

LineBeginning Before calling this method, you must run the e.preparation()

func LineEnd

func LineEnd(content bytes.Bytes, position bytes.Index, nl byte) bytes.Index

func LineNumber

func LineNumber(content bytes.Bytes, position bytes.Index, nl byte) bytes.Index

LineNumber return 0 if cannot determine the line number, or 1+ if it can

func PositionInLine

func PositionInLine(content bytes.Bytes, position bytes.Index, nl byte) bytes.Index

Types

type JAPIError

type JAPIError struct {
	Msg string
	Location
}

func NewJAPIError

func NewJAPIError(msg string, f *fs.File, i bytes.Index) *JAPIError

func (JAPIError) Error

func (e JAPIError) Error() string

type Location

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

func NewLocation

func NewLocation(f *fs.File, i bytes.Index) Location

NewLocation a bit optimized version of getting all info

func (Location) Filename

func (l Location) Filename() string

func (Location) Index

func (l Location) Index() bytes.Index

func (Location) Line

func (l Location) Line() bytes.Index

func (Location) Quote

func (l Location) Quote() string

Jump to

Keyboard shortcuts

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