causes

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AmbiguousRiderCategoryError added in v1.1.0

type AmbiguousRiderCategoryError struct {
	FareProductID   string
	RiderCategories []string
	// contains filtered or unexported fields
}

AmbiguousRiderCategoryError reports when more than one RiderCategory is allowed in a FareProductID group where IsDefaultFareCategory is set.

func NewAmbiguousRiderCategoryError added in v1.1.0

func NewAmbiguousRiderCategoryError(fareProductID string, riderCategories ...string) *AmbiguousRiderCategoryError

NewAmbiguousRiderCategoryError returns a new DuplicateRiderCategoryError.

func (*AmbiguousRiderCategoryError) Error added in v1.1.0

type ConditionallyForbiddenFieldError

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

ConditionallyForbiddenFieldError reports a value that is present but disallowed.

func NewConditionallyForbiddenFieldError

func NewConditionallyForbiddenFieldError(field string, value string, msg string) *ConditionallyForbiddenFieldError

func (*ConditionallyForbiddenFieldError) Error

type ConditionallyRequiredFieldError

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

ConditionallyRequiredFieldError reports an empty, conditionally required field.

func NewConditionallyRequiredFieldError

func NewConditionallyRequiredFieldError(field string) *ConditionallyRequiredFieldError

NewConditionallyRequiredFieldError returns a new ConditionallyRequiredFieldError

func (*ConditionallyRequiredFieldError) Error

type Context

type Context struct {
	GroupKey   string
	Filename   string
	Line       int
	ErrorCode  string
	EntityID   string
	Field      string
	Value      string
	Message    string
	EntityJson map[string]any
	// contains filtered or unexported fields
}

Context adds structured context.

func (*Context) Cause

func (e *Context) Cause() error

Cause returns the underlying error and implements the Causer interface.

func (*Context) Context

func (e *Context) Context() *Context

Context returns the base context

func (*Context) Error

func (e *Context) Error() string

func (*Context) ErrorLevel

func (e *Context) ErrorLevel() int

ErrorLevel 0 = error, 1 = warning, 2 = best practice

func (*Context) SetField

func (e *Context) SetField(v string)

func (*Context) SetFilename

func (e *Context) SetFilename(v string)

func (*Context) Update

func (e *Context) Update(v *Context)

Update sets new values, if present

type DuplicateIDError

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

DuplicateIDError reports when a unique ID is used more than once in a file.

func NewDuplicateIDError

func NewDuplicateIDError(eid string) *DuplicateIDError

NewDuplicateIDError returns a new DuplicateIDErrror

func (*DuplicateIDError) Error

func (e *DuplicateIDError) Error() string

type DuplicateKeyError added in v1.0.0

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

DuplicateIDError reports when a unique ID is used more than once in a file.

func NewDuplicateKeyError added in v1.0.0

func NewDuplicateKeyError(eid string) *DuplicateKeyError

NewDuplicateIDError returns a new DuplicateIDErrror

func (*DuplicateKeyError) Error added in v1.0.0

func (e *DuplicateKeyError) Error() string

type DuplicateServiceExceptionError

type DuplicateServiceExceptionError struct {
	ServiceID string
	Date      string
	// contains filtered or unexported fields
}

DuplicateServiceExceptionError reports when a (service_id,date) value is present more than once.

func NewDuplicateServiceExceptionError

func NewDuplicateServiceExceptionError(service string, date time.Time) *DuplicateServiceExceptionError

NewDuplicateServiceExceptionError returns a new DuplicateServiceExceptionError.

func (*DuplicateServiceExceptionError) Error

type EmptyTripError

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

EmptyTripError reports when a trip has one or zero stop times.

func NewEmptyTripError

func NewEmptyTripError(length int) *EmptyTripError

NewEmptyTripError returns a new EmptyTripError

func (*EmptyTripError) Error

func (e *EmptyTripError) Error() string

type EntityLimitError added in v1.4.0

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

EntityLimitError reports when an entity's grouped child rows — a trip's stop_times or a shape's points — exceeded the per-group limit and were capped.

func NewEntityLimitError added in v1.4.0

func NewEntityLimitError(eid string, field string, limit int) *EntityLimitError

NewEntityLimitError returns an EntityLimitError for entity eid whose `field` rows were capped at `limit`.

func (*EntityLimitError) Error added in v1.4.0

func (e *EntityLimitError) Error() string

type FieldParseError

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

FieldParseError reports a value that cannot be parsed

func NewFieldParseError

func NewFieldParseError(field string, value string) *FieldParseError

NewFieldParseError returns a new FieldParseError

func (*FieldParseError) Error

func (e *FieldParseError) Error() string

type FileDuplicateFieldError

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

FileDuplicateFieldError reports when a file contains multiple columns with the same name

func NewFileDuplicateFieldError

func NewFileDuplicateFieldError(filename string, field string) *FileDuplicateFieldError

NewFileDuplicateFieldError returns a new DuplicateFieldError

func (*FileDuplicateFieldError) Error

func (e *FileDuplicateFieldError) Error() string

type FileNotPresentError

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

FileNotPresentError is returned when a requested file is not present

func NewFileNotPresentError

func NewFileNotPresentError(filename string) *FileNotPresentError

NewFileNotPresentError returns a new FileNotPresentError

func (*FileNotPresentError) Error

func (e *FileNotPresentError) Error() string

type FileRequiredError

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

FileRequiredError reports a required file is not present

func NewFileRequiredError

func NewFileRequiredError(filename string) *FileRequiredError

NewFileRequiredError returns a new FileRequiredError

func (*FileRequiredError) Error

func (e *FileRequiredError) Error() string

type FileRequiredFieldError

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

FileRequiredFieldError reports when a file does not have a required column

func NewFileRequiredFieldError

func NewFileRequiredFieldError(filename string, field string) *FileRequiredFieldError

NewFileRequiredFieldError returns a new FileRequiredFieldError

func (*FileRequiredFieldError) Error

func (e *FileRequiredFieldError) Error() string

type FileUnreadableError

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

FileUnreadableError reports a file that could not be read

func NewFileUnreadableError

func NewFileUnreadableError(filename string, err error) *FileUnreadableError

NewFileUnreadableError returns a new FileUnreadableError

func (*FileUnreadableError) Error

func (e *FileUnreadableError) Error() string

type InvalidFieldError

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

InvalidFieldError reports an invalid value for a field

func NewInvalidFieldError

func NewInvalidFieldError(field string, value string, err error) *InvalidFieldError

NewInvalidFieldError returns a new InvalidFieldError

func (*InvalidFieldError) Error

func (e *InvalidFieldError) Error() string

type InvalidLanguageError added in v1.4.0

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

InvalidLanguageError reports a value that does not name a language.

It is reported at warning level. A language that this library does not recognize is advisory: it tells a consumer less than it should, but the stop, agency or translation it sits on is still usable, and dropping that entity would take everything referencing it along too.

func NewInvalidLanguageError added in v1.4.0

func NewInvalidLanguageError(field string, value string) *InvalidLanguageError

NewInvalidLanguageError returns a new InvalidLanguageError

func (*InvalidLanguageError) Error added in v1.4.0

func (e *InvalidLanguageError) Error() string

type InvalidReferenceError

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

InvalidReferenceError reports when an entity makes an invalid reference

func NewInvalidReferenceError

func NewInvalidReferenceError(field string, eid string) *InvalidReferenceError

NewInvalidReferenceError returns a new InvalidReferenceError

func (*InvalidReferenceError) Error

func (e *InvalidReferenceError) Error() string

type InvalidTimezoneError

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

InvalidTimezoneError reports when a timezone is not valid.

func NewInvalidTimezoneError

func NewInvalidTimezoneError(field string, value string) *InvalidTimezoneError

NewInvalidTimezoneError returns a new InvalidTimezoneError.

func (*InvalidTimezoneError) Error

func (e *InvalidTimezoneError) Error() string

type RequiredFieldError

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

RequiredFieldError reports a required field does not have a value

func NewRequiredFieldError

func NewRequiredFieldError(field string) *RequiredFieldError

NewRequiredFieldError returns a new RequiredFieldError

func (*RequiredFieldError) Error

func (e *RequiredFieldError) Error() string

type RowParseError

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

RowParseError reports an error parsing a CSV row

func NewRowParseError

func NewRowParseError(line int, err error) *RowParseError

NewRowParseError returns a new RowParseError

func (*RowParseError) Error

func (e *RowParseError) Error() string

type SequenceError

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

SequenceError reports an invalid shapes.txt or stop_times.txt sequence

func NewSequenceError

func NewSequenceError(field string, value string) *SequenceError

NewSequenceError returns a new SequenceError

func (*SequenceError) Error

func (e *SequenceError) Error() string

type SourceUnreadableError

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

SourceUnreadableError reports when the archive itself cannot be read

func NewSourceUnreadableError

func NewSourceUnreadableError(message string, err error) *SourceUnreadableError

NewSourceUnreadableError returns a new SourceUnreadableError

func (*SourceUnreadableError) Error

func (e *SourceUnreadableError) Error() string

type ValidationWarning

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

ValidationWarning reports warning messages or informational messages.

func NewValidationWarning

func NewValidationWarning(field string, message string) *ValidationWarning

NewValidationWarning returns a new ValidationWarning

func (*ValidationWarning) Error

func (e *ValidationWarning) Error() string

func (*ValidationWarning) ErrorLevel

func (e *ValidationWarning) ErrorLevel() int

ErrorLevel .

Jump to

Keyboard shortcuts

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