general

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// ConformantStatusBadRequest
	// Note: we want to keep awareness about proper
	// states but to keep in line with the SRU specification,
	// 200 is expected
	ConformantStatusBadRequest = 200

	// ConformantUnprocessableEntity
	// Note: we want to keep awareness about proper
	// states but to keep in line with the SRU specification,
	// 200 is expected
	ConformantUnprocessableEntity = 200

	// ConformandGeneralServerError
	// Note: we want to keep awareness about proper
	// states but to keep in line with the SRU specification,
	// 200 is expected
	ConformandGeneralServerError = 200

	RecordSchema = "http://clarin.eu/fcs/resource"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DiagnosticCode

type DiagnosticCode int
const (
	// General diagnostics
	DCGeneralSystemError            DiagnosticCode = 1
	DCSystemTemporarilyUnavailable  DiagnosticCode = 2
	DCAuthenticationError           DiagnosticCode = 3
	DCUnsupportedOperation          DiagnosticCode = 4
	DCUnsupportedVersion            DiagnosticCode = 5
	DCUnsupportedParameterValue     DiagnosticCode = 6
	DCMandatoryParameterNotSupplied DiagnosticCode = 7
	DCUnsupportedParameter          DiagnosticCode = 8
	DCDatabaseDoesNotExist          DiagnosticCode = 235
	// CQL related diagnostics
	DCQuerySyntaxError        DiagnosticCode = 10
	DCUnsupportedContextSet   DiagnosticCode = 15
	DCUnsupportedIndex        DiagnosticCode = 16
	DCQueryCannotProcess      DiagnosticCode = 47
	DCQueryFeatureUnsupported DiagnosticCode = 48
	// Diagnostics Relating to Records
	DCTooManyMatchingRecords    DiagnosticCode = 60
	DCFirstRecordPosOutOfRange  DiagnosticCode = 61
	DCUnknownSchemaForRetrieval DiagnosticCode = 66
	// Records related diagnostics
	DCUnsupportedRecordPacking DiagnosticCode = 71
)

https://www.loc.gov/standards/sru/diagnostics/diagnosticsList.html used with diagnostic type 1

func (DiagnosticCode) AsMessage

func (dc DiagnosticCode) AsMessage() string

type DiagnosticType

type DiagnosticType int
const (
	DTPersistent                            DiagnosticType = 1  // generally non-fatal, with code fatal?
	DTResourceSetTooLarge                   DiagnosticType = 2  // non-fatal
	DTResourceSetTooLargeCannotPerformQuery DiagnosticType = 3  // fatal
	DTRequestedDataViewNotValid             DiagnosticType = 4  // non-fatal
	DTGeneralQuerySyntaxError               DiagnosticType = 10 // fatal, return only this one
	DTQueryTooComplex                       DiagnosticType = 11 // fatal, return only this one
	DTQueryWasRewritten                     DiagnosticType = 12 // non-fatal, only advanced query with `x-fcs-rewrites-allowed`
	DTGeneralProcessingHint                 DiagnosticType = 14 // non-fatal, only advanced query
)

from appendix A FCS 2.0 documentation

type FCSError

type FCSError struct {
	Type    DiagnosticType
	Code    DiagnosticCode
	Ident   string
	Message string
}

func (FCSError) Error

func (fe FCSError) Error() string

func (FCSError) IsFatal

func (fe FCSError) IsFatal() bool

func (FCSError) Overthrow

func (fe FCSError) Overthrow() bool

type FCSGeneralResponse

type FCSGeneralResponse struct {
	Version string
	Errors  []FCSError
	Fatal   bool

	// Context allows us to inject the diagnostic xml
	// into different responses, e.g.:
	// <scan:diagnostics>....
	// vs.
	// <sruResponse:diagnostics>
	DiagXMLContext string

	// XSLT is an optional path of a XSL template
	// for outputting formatted (typically HTML) result
	XSLT string
}

func (*FCSGeneralResponse) AddError

func (r *FCSGeneralResponse) AddError(fcsError FCSError)

func (*FCSGeneralResponse) HasFatalError

func (r *FCSGeneralResponse) HasFatalError() bool

type VersionInfo

type VersionInfo struct {
	Version   string `json:"version"`
	BuildDate string `json:"buildDate"`
	GitCommit string `json:"gitCommit"`
}

VersionInfo provides a detailed information about the actual build

Jump to

Keyboard shortcuts

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