load

package
v0.0.0-...-361bbb7 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package load provides a function to load an OpenAPI spec from a URL or a Path.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func From

func From(loader Loader, source Source) (*openapi3.T, error)

From is a convenience function that opens an OpenAPI spec from a URL or a local path based on the format of the path parameter

Types

type Loader

type Loader interface {
	LoadFromURI(*url.URL) (*openapi3.T, error)
	LoadFromFile(string) (*openapi3.T, error)
	LoadFromStdin() (*openapi3.T, error)
}

Loader interface includes the OAS load functions

type Source

type Source struct {
	Path  string
	Stdin bool
}

func NewSource

func NewSource(path string) Source

func (*Source) Out

func (source *Source) Out() string

type SpecInfo

type SpecInfo struct {
	Url     string
	Spec    *openapi3.T
	Version string
}

func FromGlob

func FromGlob(loader Loader, glob string) ([]*SpecInfo, error)

FromGlob creates SpecInfo specs from local files matching the specified glob parameter

func LoadSpecInfo

func LoadSpecInfo(loader Loader, source Source) (*SpecInfo, error)

LoadSpecInfo creates a SpecInfo from a local file path, a URL, or stdin

func (*SpecInfo) GetVersion

func (specInfo *SpecInfo) GetVersion() string

type SpecInfoPair

type SpecInfoPair struct {
	Base     *SpecInfo
	Revision *SpecInfo
}

func NewSpecInfoPair

func NewSpecInfoPair(specInfo1, specInfo2 *SpecInfo) *SpecInfoPair

func (*SpecInfoPair) GetBaseVersion

func (specInfoPair *SpecInfoPair) GetBaseVersion() string

func (*SpecInfoPair) GetRevisionVersion

func (specInfoPair *SpecInfoPair) GetRevisionVersion() string

Jump to

Keyboard shortcuts

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