scraper

package
v8.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package scraper provides support for scraping OpenAPI versions from services.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DurationTransport

func DurationTransport(next http.RoundTripper) http.RoundTripper

DurationTransport returns a http.RoundTripper for tracking http calls made from the Scraper.

Types

type Option

type Option func(*Scraper) error

Option defines an option that may be specified when creating a new Scraper.

func Clock

func Clock(c func() time.Time) Option

Clock is a Scraper constructor Option that allows providing an alternative clock used to determine the scrape timestamps used to record changes in service spec versions.

func HTTPClient

func HTTPClient(cl *http.Client) Option

HTTPClient is a Scraper constructor Option that allows providing an *http.Client instance. This may be used to configure the transport and timeouts on the HTTP client.

type Scraper

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

Scraper gets OpenAPI specs from a collection of services and updates storage accordingly.

func New

func New(cfg *config.ServerConfig, store storage.Storage, options ...Option) (*Scraper, error)

New returns a new Scraper instance.

func (*Scraper) Run

func (s *Scraper) Run(ctx context.Context) error

Run executes the OpenAPI version scraping on all configured services.

Jump to

Keyboard shortcuts

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