models

package
v0.0.0-...-c2a27a2 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Error Codes
	ErrMaxRecordLimitCode = iota + 1000
	ErrFailedConversionCode
	ErrUnknownRecordTypeStringCode
	ErrUnknownTextMatchStringCode
	ErrRequiredParamCode
	ErrUnauthorizedCode
	ErrProcessingRequestCode
	ErrNotFoundCode
)

Variables

View Source
var TextMatchStrings = []string{
	"exact",
	"partial",
}

Functions

This section is empty.

Types

type Error

type Error struct {
	Code    int
	Message string
}

Error represents an error code and message

func (Error) Error

func (err Error) Error() string

Error returns the error as a formatted string

type Record

type Record struct {
	Id        string                `json:"id"`
	Surt      string                `json:"surt"`
	Timestamp time.Time             `json:"timestamp"`
	Type      simplecdxj.RecordType `json:"type"`
	Content   warcindexer.JsonBlock `json:"content"`
}

Record represents a single CDXJ record

type Records

type Records struct {
	Count   int      `json:"count"`
	Results []Record `json:"results"`
}

Records represents a list of CDXJ records

type TextMatch

type TextMatch int
const (
	TextMatchExact TextMatch = iota
	TextMatchPartial
)

func ToTextMatch

func ToTextMatch(m string) (TextMatch, error)

func (TextMatch) String

func (tm TextMatch) String() (match string)

Jump to

Keyboard shortcuts

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