arxiv

package
v0.0.0-...-d693f84 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2018 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Search(ctx context.Context, q *Query) (chan *ResultsPage, cancelFn, error)

Types

type Category

type Category string
const (
	StatisticsApplications                     Category = "stat.AP"
	StatisticsComputation                      Category = "stat.CO"
	StatisticsMachineLearning                  Category = "stat.ML"
	StatisticsMethodology                      Category = "stat.ME"
	StatisticsTheory                           Category = "stat.TH"
	QuantitativeBiologyBiomolecules            Category = "q-bio.BM"
	QuantitativeBiologyCellBehavior            Category = "q-bio.CB"
	QuantitativeBiologyGenomics                Category = "q-bio.GN"
	QuantitativeBiologyMolecularNetworks       Category = "q-bio.MN"
	QuantitativeBiologyNeuronsAndCognition     Category = "q-bio.NC"
	QuantitativeBiologyOther                   Category = "q-bio.OT"
	QuantitativeBiologyPopulationsAndEvolution Category = "q-bio.PE"
	QuantitativeBiologyQuantitativeMethods     Category = "q-bio.QM"
	QuantitativeBiologySubcellularProcesses    Category = "q-bio.SC"
	QuantitativeBiologyTissuesAndOrgans        Category = "q-bio.TO"
	CSArchitecture                             Category = "cs.AR"
	CSArtificialIntelligence                   Category = "cs.AI"
	CSComputationAndLanguage                   Category = "cs.CL"
	ComputationalComplexity                    Category = "cs.CC"
	ComputationalEngineeringFinanceAndScience  Category = "cs.CE"
	CSComputationalGeometry                    Category = "cs.CG"
	CSGameTheory                               Category = "cs.GT"
	ComputerVisionAndPatternRecognition        Category = "cs.CV"

	ComputersAndSociety                                         Category = "cs.CY"
	CryptographyAndSecurity                                     Category = "cs.CR"
	Databases                                                   Category = "cs.DB"
	DigitalLibraries                                            Category = "cs.DL"
	DiscreteMathematics                                         Category = "cs.DM"
	DistributedParallelAndClusterComputing                      Category = "cs.DC"
	CSGeneralLiterature                                         Category = "cs.GL"
	CSGraphics                                                  Category = "cs.GR"
	HumanComputerInteraction                                    Category = "cs.HC"
	CSInformationRetrieval                                      Category = "cs.IR"
	CSInformationTheory                                         Category = "cs.IT"
	CSLearning                                                  Category = "cs.LG"
	CSLogic                                                     Category = "cs.LO"
	CSMathematicalSoftware                                      Category = "cs.MS"
	MultiagentSystems                                           Category = "cs.MA"
	CSMultimedia                                                Category = "cs.MM"
	NetworkAndInternetArchitecture                              Category = "cs.NI"
	NeuralAndEvolutionaryComputing                              Category = "cs.NE"
	CSNumericalAnalysis                                         Category = "cs.NA"
	OperatingSystems                                            Category = "cs.OS"
	CSOther                                                     Category = "cs.OH"
	CSPerformance                                               Category = "cs.PF"
	ProgrammingLanguages                                        Category = "cs.PL"
	CSRobotics                                                  Category = "cs.RO"
	SoftwareEngineering                                         Category = "cs.SE"
	CSSound                                                     Category = "cs.SD"
	SymbolicComputation                                         Category = "cs.SC"
	NonLinearSciencesAdaptationAndSelfOrganizingSystemsCategory          = "nlin.AO"
	NonLinearSciencesCellularAutomataAndLatticeGases            Category = "nlin.CG"
	NonLinearSciencesChaoticDynamics                            Category = "nlin.CD"
	ExactlySolvableAndIntegrableSytems                          Category = "nlin.SI"
	PatternFormationAndSolutions                                Category = "nlin.PS"
	AlgebraicGeometry                                           Category = "math.AG"
	AlgebraicTopology                                           Category = "math.AT"
	AnalysisOfPDEs                                              Category = "math.AP"
	CategoryTheory                                              Category = "math.CT"
	ClassicalAnalysisAndODEs                                    Category = "math.CA"
	Combinatorics                                               Category = "math.CO"
	CommutativeAlgebra                                          Category = "math.AC"
	ComplexVariables                                            Category = "math.CV"
	DifferentialGeometry                                        Category = "math.DG"
	DynamicalSystems                                            Category = "math.DS"
	FunctionalAnalysis                                          Category = "math.FA"
	GeneralMathematics                                          Category = "math.GM"
	GeneralTopology                                             Category = "math.GN"
	GeometricTopology                                           Category = "math.GT"
	GroupTheory                                                 Category = "math.GR"
	MathsHistoryAndOverview                                     Category = "math.HO"
	MathsInformationTheory                                      Category = "math.IT"
	KTheoryAndHomology                                          Category = "math.KT"
	MathsLogic                                                  Category = "math.LO"
	MathsMathematicalPhysics                                    Category = "math.MP"
	MetricGeometry                                              Category = "math.MG"
	NumberTheory                                                Category = "math.NT"
	MathsNumericalAnalysis                                      Category = "math.NA"
	OperatorAlgebras                                            Category = "math.OA"
	MathsOptimizationAndControl                                 Category = "math.OC"
	Probability                                                 Category = "math.PR"
	QuantumAlgebra                                              Category = "math.QA"
	RepresentationTheory                                        Category = "math.RT"
	RingsAndAlgebra                                             Category = "math.RA"
	MathsSpectralTheory                                         Category = "math.SP"
	MathsStatics                                                Category = "math.ST"
	SymplecticGeometry                                          Category = "math.SG"
	Astrophysics                                                Category = "astro-ph"
	PhysicsDisorderedSystemsAndNeuralNetworks                   Category = "cond-mat.dis-nn"
	PhysicsMesoscopicSystemsAndQuantumHallEffect                Category = "cond-mat.mes-hall"
	PhysicsMaterialsScience                                     Category = "cond-mat.mtrl-sci"
	PhysicsOther                                                Category = "cond-mat.other"
	PhysicsSoftCondensedMatter                                  Category = "cond-mat.soft"
	PhysicsStatisticalMechanics                                 Category = "cond-mat.stat-mech"
	PhysicsStronglyCorrelatedElectrons                          Category = "cond-mat.str-el"
	PhysicsSuperconductivity                                    Category = "cond-mat.sup-con"
	GeneralRelativityAndQuantumCosmology                        Category = "gr-qc"
	HighEneryPhysicsExperiment                                  Category = "hep-ex"
	HighEneryPhysicsLattice                                     Category = "hep-lat"
	HighEneryPhysicsPhenomenology                               Category = "hep-ph"
	HighEneryPhysicsTheory                                      Category = "hep-th"
	MathematicalPhysics                                         Category = "math-ph"
	NuclearExperiment                                           Category = "nucl-ex"
	NuclearTheory                                               Category = "nucl-th"
	AcceleratorPhysics                                          Category = "physics.acc-ph"
	AtmoshpericAndOceanicPhysics                                Category = "physics.ao-ph"
	AtomicPhysics                                               Category = "physics.atom-ph"
	AtomicAndMolecularClusters                                  Category = "physics.atm-clus"
	BiologicalPhysics                                           Category = "physics.bio-ph"
	ChemicalPhysics                                             Category = "physics.chem-ph"
	ClassicalPhysics                                            Category = "physics.class-ph"
	ComputationalPhysics                                        Category = "physics.comp-ph"
	DataAnalysisStatisticsAndProbability                        Category = "physics.data-an"
	FluidDynamics                                               Category = "physics.flu-dyn"
	GeneralPhysics                                              Category = "physics.gen-ph"
	Geophysics                                                  Category = "physics.geo-ph"
	HistoryOfPhysics                                            Category = "physics.hist-ph"
	InstrumentationAndDetectors                                 Category = "physics.ins-det"
	MedicalPhysics                                              Category = "physics.med-ph"
	Optics                                                      Category = "physics.optics"
	PhysicsEducation                                            Category = "physics.ed-ph"
	PhysicsAndSociety                                           Category = "physics.soc-ph"
	PlasmaPhysics                                               Category = "physiscs.plasm-ph"
	PopularPhysics                                              Category = "physics.pop-ph"
	SpacePhysics                                                Category = "physics.space-ph"
	QuantumPhysics                                              Category = "quant-ph"
)

type Client

type Client struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*Client) Search

func (c *Client) Search(ctx context.Context, q *Query) (chan *ResultsPage, cancelFn, error)

func (*Client) SetHTTPRoundTripper

func (c *Client) SetHTTPRoundTripper(rt http.RoundTripper)

type Field

type Field struct {
	Title            string   `json:"ti,omitempty"`
	Author           string   `json:"au,omitempty"`
	Category         Category `json:"cat,omitempty"`
	Abstract         string   `json:"abs,omitempty"`
	Comment          string   `json:"co,omitempty"`
	ReportNumber     int64    `json:"rn,omitempty"`
	JournalReference string   `json:"jn,omitempty"`

	All string `json:"all,omitempty"`
}

type Filter

type Filter struct {
	Op     Operator `json:"op,omitempty"`
	Fields []*Field `json:"fields,omitempty"`
}

func (*Filter) Pairfy

func (f *Filter) Pairfy() string

Transform:

var _ = []Filter{
	{
		Op: OpAnd,
		Fields: []*Field{
			{Author: "Adrian DelMaestro"},
			{Title: "Checkerboard"},
		},
	},
}

Into: au:Adrian%20DelMaestro AND ti:checkerboard

type Filters

type Filters []*Filter

func (Filters) String

func (fl Filters) String() string

type Operator

type Operator string
const (
	OpAnd    Operator = "AND"
	OpOR     Operator = "OR"
	OpAndNot Operator = "ANDNOT"
	OpAll    Operator = "all"
)

type Query

type Query struct {
	MaxPageNumber int64 `json:"max_page"`

	Terms string `json:"search_query"`

	Filters Filters `json:"filters"`

	PageNumber int64 `json:"start"`

	MaxResultsPerPage int64 `json:"max_results"`

	// ArticleIDs is the specific set of articles
	// to be searched for by the API.
	ArticleIDs []string `json:"id_list"`

	SortBy    SortBy    `json:"sortBy"`
	SortOrder SortOrder `json:"sortOrder"`

	// ThrottleSeconds determines the period that it'll
	// wait before making the next pagination request.
	// arxiv.org recommends that you set it to 3 seconds
	// to play nice. If this value is unset, the recommended
	// 3 second throttle duration will be used.
	// Set it to a negative value e.g -1 for no throttling.
	ThrottleSeconds int64 `json:"throttle_seconds"`
}

func (*Query) Validate

func (q *Query) Validate() error

type ResultsPage

type ResultsPage struct {
	Feed *atom.Feed `json:"feed"`

	PageNumber int64 `json:"page_number"`

	Err error `json:"error"`
}

type SortBy

type SortBy string
const (
	SortByRelevance       SortBy = "relevance"
	SortBySubmittedDate   SortBy = "submittedDate"
	SortByLastUpdatedDate SortBy = "lastUpdatedDate"
)

type SortOrder

type SortOrder string
const (
	SortAscending  SortOrder = "ascending"
	SortDescending SortOrder = "descending"
)

Jump to

Keyboard shortcuts

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