scraper

package
v0.0.0-...-14efb62 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// info extension key
	INFO_EXTENSION_OWNER = "x-owner"

	// component extension key
	COMPONENT_EXTENSION_NAME = "name"

	// path extension key
	PATH_EXTENSION_URL      = "url"
	PATH_EXTENSION_ACTION   = "action"
	PATH_EXTENSION_EXAMPLES = "x-examples"
)
View Source
const (
	DOCS_INDEX = "window.RailsData"
)

Variables

This section is empty.

Functions

func Spider

func Spider[T any](s http.Client, url string, cb SpiderHandlerFunc[T]) (*T, error)

Types

type LandingPageData

type LandingPageData struct {
	Title               string `json:"title"`
	Description         string `json:"description"`
	ResourceUnsupported string `json:"resource_unsupported"`
}

type ShopifyAPIMeta

type ShopifyAPIMeta struct {
	BasePath             string                `json:"base_path"`
	RestSideNav          []*ShopifyRestSideNav `json:"rest_sidenav,omitempty"`
	RestResource         *ShopifyOpenAPISpec   `json:"rest_resource,omitempty"`
	SelectableVersions   []string              `json:"selectable_versions"`
	CurrentStableVersion string                `json:"current_stable_version"`
	LandingPage          string                `json:"landing_page"`
	LandingPageId        string                `json:"landing_page_id"`
	LandingPageData      LandingPageData       `json:"landing_page_data"`
}

type ShopifyDocsMeta

type ShopifyDocsMeta struct {
	Features []string        `json:"features"`
	Env      string          `json:"env"`
	API      *ShopifyAPIMeta `json:"api"`
}

type ShopifyOpenAPISpec

type ShopifyOpenAPISpec struct {
	Info         openapi3.Info              `json:"info"`
	XShopifyMeta XShopifyMeta               `json:"x-shopify-meta"`
	OpenAPI      string                     `json:"openapi" yaml:"openapi"` // Required
	Components   []*ShopifyOpenapiComponent `json:"components,omitempty" yaml:"components,omitempty"`
	Paths        []*openapi3.Operation      `json:"paths" yaml:"paths"` // Required
}

type ShopifyOpenapiComponent

type ShopifyOpenapiComponent struct {
	Name       string             `json:"name"`
	Properties []*openapi3.Schema `json:"properties,omitempty"`
	Required   []string           `json:"required,omitempty" yaml:"required,omitempty"`
	Type       string             `json:"type,omitempty" yaml:"type,omitempty"`
	Title      string             `json:"title,omitempty" yaml:"title,omitempty"`
}

type ShopifyRestSideNav

type ShopifyRestSideNav struct {
	Key      string               `json:"key"`
	Label    string               `json:"label"`
	Children []ShopifyRestSideNav `json:"children,omitempty"`
}

type SpiderHandlerFunc

type SpiderHandlerFunc[T any] func(*goquery.Document) (*T, error)

func ExtraShopifyOpenApiMeta

func ExtraShopifyOpenApiMeta(version string) SpiderHandlerFunc[ShopifyAPIMeta]

type XShopifyMeta

type XShopifyMeta struct {
	ApiVersioning   bool   `json:"api_versioning"`
	Filename        string `json:"filename"`
	Gid             string `json:"gid"`
	Glossary        bool   `json:"glossary"`
	Hidden          bool   `json:"hidden"`
	MetaDescription string `json:"meta_description"`
	PostmanGroup    string `json:"postman_group"`
}

Jump to

Keyboard shortcuts

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