apispec

package
v0.26.7 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSpecURL added in v0.12.0

func GetSpecURL(domain string, svc akid.ServiceID, spec akid.APISpecID) url.URL

func ParseFromHAR added in v0.21.2

func ParseFromHAR(col trace.Collector, log *hl.CustomHARLog) (int, sampled_err.Errors)

Returns the number of entries successfully collected from the given HAR log.

func ProcessHAR added in v0.12.0

func ProcessHAR(col trace.Collector, p string) (int, error)

Extract witnesses from a local HAR file and send them to the collector. Returns the number of entries extracted.

func ProcessHAREntry added in v0.12.0

func ProcessHAREntry(col trace.Collector, harUUID uuid.UUID, seqNum int, entry hl.CustomHAREntry, errs *sampled_err.Errors) bool

Processes a single entry from a HAR file. The UUID identifies the HAR file, whereas the seqNum identifies the entry within the file.

If any errors occur, the given Errors is updated, and false is returned. Otherwise, true is returned on success.

func Run

func Run(args Args) error

func WriteSpec added in v0.17.0

func WriteSpec(out io.Writer, spec string) error

Types

type Args

type Args struct {
	// Required
	ClientID akid.ClientID
	Domain   string
	Traces   []location.Location

	// If unset, defaults to a randomly generated backend learn session.
	Out location.Location

	Service                    string
	Format                     string
	Tags                       map[tags.Key]string
	Versions                   []string
	GetSpecEnableRelatedFields bool
	IncludeTrackers            bool
	PathParams                 []string
	PathExclusions             []string
	Timeout                    *time.Duration
	TimeRange                  *time_span.TimeSpan

	GitHubBranch string
	GitHubCommit string
	GitHubRepo   string
	GitHubPR     int

	GitLabMR *gitlab.MRInfo

	Plugins []plugin.AkitaPlugin

	// Legacy -- used by `akita learn-sessions checkpoint`.
	LearnSessionID *akid.LearnSessionID
}

type ReconstructedTimestamps added in v0.12.0

type ReconstructedTimestamps struct {
	RequestStart  time.Time
	RequestEnd    time.Time
	ResponseStart time.Time
	ResponseEnd   time.Time
}

ReconstructedTimestamps holds times we can use to fill in a ParsedNetworkTraffic, in such a way that the reported latencies in the Witness will end up the same as in the HAR file. (Because I couldn't think of a good way to pass the measurements through the to two separate Process calls, without major refactoring.)

In the future, we could save these timestamps directly in a custom field, or pass the interval values through.

Jump to

Keyboard shortcuts

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