Documentation
¶
Index ¶
- Constants
- Variables
- func CheckDrift(path string, data []byte) error
- func CleanupDriver(driverDir string, keep bool)
- func DriverDir(cfg Config) string
- func EnsureOpenAPIModule(cfg Config) error
- func ResolveOutputPath(cfg Config) string
- func RunDriver(driverDir string) ([]byte, string, error)
- func RunPipeline(cfg Config) ([]byte, []string, error)
- func Serve(cfg Config, serveCfg ServeConfig) error
- func WriteAtomic(path string, data []byte) error
- func WriteDriver(cfg Config, entry Entry, hook *Hook) (string, error)
- type Config
- type DriverData
- type DriverError
- type Entry
- type ExternalDocsConfig
- type Hook
- type InfoConfig
- type OAuthFlow
- type OAuthFlows
- type Overrides
- type Scheme
- type ServeConfig
- type ServerConfig
- type TagConfig
Constants ¶
View Source
const ( ExitUsage = 1 ExitBuildFailed = 2 ExitRunFailed = 3 ExitDrift = 4 ExitWriteFailed = 5 )
Variables ¶
View Source
var ErrDrift = errors.New("openapi output is out of date")
Functions ¶
func CheckDrift ¶
func CleanupDriver ¶
func EnsureOpenAPIModule ¶
func ResolveOutputPath ¶
func Serve ¶
func Serve(cfg Config, serveCfg ServeConfig) error
func WriteAtomic ¶
Types ¶
type Config ¶
type Config struct {
ConfigPath string
ConfigExplicit bool
Entry string `yaml:"entry"`
Out string `yaml:"out"`
Format string `yaml:"format"`
Sources []string `yaml:"sources"`
IncludeTestFiles bool `yaml:"includeTestFiles"`
Info InfoConfig `yaml:"info"`
Servers []ServerConfig `yaml:"servers"`
Tags []TagConfig `yaml:"tags"`
SecuritySchemes map[string]Scheme `yaml:"securitySchemes"`
MetadataHook string `yaml:"metadataHook"`
AutoAdd bool `yaml:"autoAdd"`
Workdir string `yaml:"workdir"`
KeepDriver bool `yaml:"keepDriver"`
Verbose bool `yaml:"verbose"`
}
func LoadConfig ¶
type DriverData ¶
type DriverData struct {
Entry Entry
Hook Hook
HasHook bool
Format string
OptionSnippets []string
InfoDescription string
ServerDescriptions []string
TagSnippets []string
}
func BuildDriverData ¶
func BuildDriverData(cfg Config, entry Entry, hook *Hook) (DriverData, error)
type DriverError ¶
func (*DriverError) Error ¶
func (e *DriverError) Error() string
type Entry ¶
func ResolveEntry ¶
type ExternalDocsConfig ¶
type Hook ¶
func ResolveHook ¶
type InfoConfig ¶
type OAuthFlows ¶
type Overrides ¶
type Overrides struct {
ConfigPath string
ConfigExplicit bool
Entry string
EntrySet bool
Out string
OutSet bool
Format string
FormatSet bool
Sources []string
SourcesSet bool
IncludeTestFiles bool
IncludeTestFilesSet bool
MetadataHook string
MetadataHookSet bool
AutoAdd bool
AutoAddSet bool
Workdir string
WorkdirSet bool
KeepDriver bool
KeepDriverSet bool
Verbose bool
VerboseSet bool
}
type ServerConfig ¶
type TagConfig ¶
type TagConfig struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
ExternalDocs *ExternalDocsConfig `yaml:"externalDocs"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.