Documentation
¶
Index ¶
- Variables
- func HandleResponse(response *Response, outputLocation string) error
- type Environment
- type File
- func (*File) Descriptor() ([]byte, []int)
- func (m *File) GetData() []byte
- func (m *File) GetName() string
- func (*File) ProtoMessage()
- func (m *File) Reset()
- func (m *File) String() string
- func (m *File) XXX_DiscardUnknown()
- func (m *File) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *File) XXX_Merge(src proto.Message)
- func (m *File) XXX_Size() int
- func (m *File) XXX_Unmarshal(b []byte) error
- type Message
- func (*Message) Descriptor() ([]byte, []int)
- func (m *Message) GetCode() string
- func (m *Message) GetKeys() []string
- func (m *Message) GetLevel() Message_Level
- func (m *Message) GetText() string
- func (*Message) ProtoMessage()
- func (m *Message) Reset()
- func (m *Message) String() string
- func (m *Message) XXX_DiscardUnknown()
- func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Message) XXX_Merge(src proto.Message)
- func (m *Message) XXX_Size() int
- func (m *Message) XXX_Unmarshal(b []byte) error
- type Message_Level
- type Messages
- func (*Messages) Descriptor() ([]byte, []int)
- func (m *Messages) GetMessages() []*Message
- func (*Messages) ProtoMessage()
- func (m *Messages) Reset()
- func (m *Messages) String() string
- func (m *Messages) XXX_DiscardUnknown()
- func (m *Messages) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Messages) XXX_Merge(src proto.Message)
- func (m *Messages) XXX_Size() int
- func (m *Messages) XXX_Unmarshal(b []byte) error
- type Parameter
- func (*Parameter) Descriptor() ([]byte, []int)
- func (m *Parameter) GetName() string
- func (m *Parameter) GetValue() string
- func (*Parameter) ProtoMessage()
- func (m *Parameter) Reset()
- func (m *Parameter) String() string
- func (m *Parameter) XXX_DiscardUnknown()
- func (m *Parameter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Parameter) XXX_Merge(src proto.Message)
- func (m *Parameter) XXX_Size() int
- func (m *Parameter) XXX_Unmarshal(b []byte) error
- type Request
- func (request *Request) AddModel(modelType string, model proto.Message) error
- func (*Request) Descriptor() ([]byte, []int)
- func (m *Request) GetCompilerVersion() *Version
- func (m *Request) GetModels() []*any.Any
- func (m *Request) GetOutputPath() string
- func (m *Request) GetParameters() []*Parameter
- func (m *Request) GetSourceName() string
- func (*Request) ProtoMessage()
- func (m *Request) Reset()
- func (m *Request) String() string
- func (m *Request) XXX_DiscardUnknown()
- func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Request) XXX_Merge(src proto.Message)
- func (m *Request) XXX_Size() int
- func (m *Request) XXX_Unmarshal(b []byte) error
- type Response
- func (*Response) Descriptor() ([]byte, []int)
- func (m *Response) GetErrors() []string
- func (m *Response) GetFiles() []*File
- func (m *Response) GetMessages() []*Message
- func (*Response) ProtoMessage()
- func (m *Response) Reset()
- func (m *Response) String() string
- func (m *Response) XXX_DiscardUnknown()
- func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Response) XXX_Merge(src proto.Message)
- func (m *Response) XXX_Size() int
- func (m *Response) XXX_Unmarshal(b []byte) error
- type Version
- func (*Version) Descriptor() ([]byte, []int)
- func (m *Version) GetMajor() int32
- func (m *Version) GetMinor() int32
- func (m *Version) GetPatch() int32
- func (m *Version) GetSuffix() string
- func (*Version) ProtoMessage()
- func (m *Version) Reset()
- func (m *Version) String() string
- func (m *Version) XXX_DiscardUnknown()
- func (m *Version) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Version) XXX_Merge(src proto.Message)
- func (m *Version) XXX_Size() int
- func (m *Version) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var Message_Level_name = map[int32]string{
0: "UNKNOWN",
1: "INFO",
2: "WARNING",
3: "ERROR",
4: "FATAL",
}
View Source
var Message_Level_value = map[string]int32{
"UNKNOWN": 0,
"INFO": 1,
"WARNING": 2,
"ERROR": 3,
"FATAL": 4,
}
Functions ¶
func HandleResponse ¶
Types ¶
type Environment ¶
type Environment struct {
Request *Request // plugin request object
Response *Response // response message
Invocation string // string representation of call
RunningAsPlugin bool // true if app is being run as a plugin
Verbose bool // if true, plugin should log details to stderr
}
Environment contains the environment of a plugin call.
func NewEnvironment ¶
func NewEnvironment() (env *Environment, err error)
NewEnvironment creates a plugin context from arguments and standard input.
func (*Environment) RespondAndExit ¶
func (env *Environment) RespondAndExit()
RespondAndExit serializes and returns the plugin response and then exits.
func (*Environment) RespondAndExitIfError ¶
func (env *Environment) RespondAndExitIfError(err error)
RespondAndExitIfError checks an error and if it is non-nil, records it and serializes and returns the response and then exits.
type File ¶
type File struct {
// name of the file
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// data to be written to the file
Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
File describes a file generated by a plugin.
func (*File) Descriptor ¶
func (*File) ProtoMessage ¶
func (*File) ProtoMessage()
func (*File) XXX_DiscardUnknown ¶ added in v0.3.1
func (m *File) XXX_DiscardUnknown()
func (*File) XXX_Marshal ¶ added in v0.3.1
func (*File) XXX_Unmarshal ¶ added in v0.3.1
type Message ¶ added in v0.2.0
type Message struct {
// message severity
Level Message_Level `protobuf:"varint,1,opt,name=level,proto3,enum=gnostic.plugin.v1.Message_Level" json:"level,omitempty"`
// a unique message identifier
Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"`
// message text
Text string `protobuf:"bytes,3,opt,name=text,proto3" json:"text,omitempty"`
// an associated key path in an API description
Keys []string `protobuf:"bytes,4,rep,name=keys,proto3" json:"keys,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
Plugins can return messages to be collated and reported by gnostic.
func (*Message) Descriptor ¶ added in v0.2.0
func (*Message) GetLevel ¶ added in v0.2.0
func (m *Message) GetLevel() Message_Level
func (*Message) ProtoMessage ¶ added in v0.2.0
func (*Message) ProtoMessage()
func (*Message) XXX_DiscardUnknown ¶ added in v0.3.1
func (m *Message) XXX_DiscardUnknown()
func (*Message) XXX_Marshal ¶ added in v0.3.1
func (*Message) XXX_Unmarshal ¶ added in v0.3.1
type Message_Level ¶ added in v0.2.0
type Message_Level int32
const ( Message_UNKNOWN Message_Level = 0 Message_INFO Message_Level = 1 Message_WARNING Message_Level = 2 Message_ERROR Message_Level = 3 Message_FATAL Message_Level = 4 )
func (Message_Level) EnumDescriptor ¶ added in v0.2.0
func (Message_Level) EnumDescriptor() ([]byte, []int)
func (Message_Level) String ¶ added in v0.2.0
func (x Message_Level) String() string
type Messages ¶ added in v0.2.0
type Messages struct {
Messages []*Message `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*Messages) Descriptor ¶ added in v0.2.0
func (*Messages) GetMessages ¶ added in v0.2.0
func (*Messages) ProtoMessage ¶ added in v0.2.0
func (*Messages) ProtoMessage()
func (*Messages) XXX_DiscardUnknown ¶ added in v0.3.1
func (m *Messages) XXX_DiscardUnknown()
func (*Messages) XXX_Marshal ¶ added in v0.3.1
func (*Messages) XXX_Unmarshal ¶ added in v0.3.1
type Parameter ¶
type Parameter struct {
// The name of the parameter as specified in the option string
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// The parameter value as specified in the option string
Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
A parameter passed to the plugin from (or through) gnostic.
func (*Parameter) Descriptor ¶
func (*Parameter) ProtoMessage ¶
func (*Parameter) ProtoMessage()
func (*Parameter) XXX_DiscardUnknown ¶ added in v0.3.1
func (m *Parameter) XXX_DiscardUnknown()
func (*Parameter) XXX_Marshal ¶ added in v0.3.1
func (*Parameter) XXX_Unmarshal ¶ added in v0.3.1
type Request ¶
type Request struct {
// filename or URL of the original source document
SourceName string `protobuf:"bytes,1,opt,name=source_name,json=sourceName,proto3" json:"source_name,omitempty"`
// Output path specified in the plugin invocation.
OutputPath string `protobuf:"bytes,2,opt,name=output_path,json=outputPath,proto3" json:"output_path,omitempty"`
// Plugin parameters parsed from the invocation string.
Parameters []*Parameter `protobuf:"bytes,3,rep,name=parameters,proto3" json:"parameters,omitempty"`
// The version number of gnostic.
CompilerVersion *Version `protobuf:"bytes,4,opt,name=compiler_version,json=compilerVersion,proto3" json:"compiler_version,omitempty"`
// API models
Models []*any.Any `protobuf:"bytes,5,rep,name=models,proto3" json:"models,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
An encoded Request is written to the plugin's stdin.
func (*Request) Descriptor ¶
func (*Request) GetCompilerVersion ¶
func (*Request) GetOutputPath ¶
func (*Request) GetParameters ¶
func (*Request) GetSourceName ¶
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
func (*Request) XXX_DiscardUnknown ¶ added in v0.3.1
func (m *Request) XXX_DiscardUnknown()
func (*Request) XXX_Marshal ¶ added in v0.3.1
func (*Request) XXX_Unmarshal ¶ added in v0.3.1
type Response ¶
type Response struct {
// Error message. If non-empty, the plugin failed.
// The plugin process should exit with status code zero
// even if it reports an error in this way.
//
// This should be used to indicate errors which prevent the plugin from
// operating as intended. Errors which indicate a problem in gnostic
// itself -- such as the input Document being unparseable -- should be
// reported by writing a message to stderr and exiting with a non-zero
// status code.
Errors []string `protobuf:"bytes,1,rep,name=errors,proto3" json:"errors,omitempty"`
// file output, each file will be written by gnostic to an appropriate location.
Files []*File `protobuf:"bytes,2,rep,name=files,proto3" json:"files,omitempty"`
// informational messages to be collected and reported by gnostic.
Messages []*Message `protobuf:"bytes,3,rep,name=messages,proto3" json:"messages,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
The plugin writes an encoded Response to stdout.
func (*Response) Descriptor ¶
func (*Response) GetMessages ¶ added in v0.2.0
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) XXX_DiscardUnknown ¶ added in v0.3.1
func (m *Response) XXX_DiscardUnknown()
func (*Response) XXX_Marshal ¶ added in v0.3.1
func (*Response) XXX_Unmarshal ¶ added in v0.3.1
type Version ¶
type Version struct {
Major int32 `protobuf:"varint,1,opt,name=major,proto3" json:"major,omitempty"`
Minor int32 `protobuf:"varint,2,opt,name=minor,proto3" json:"minor,omitempty"`
Patch int32 `protobuf:"varint,3,opt,name=patch,proto3" json:"patch,omitempty"`
// A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should
// be empty for mainline stable releases.
Suffix string `protobuf:"bytes,4,opt,name=suffix,proto3" json:"suffix,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
The version number of gnostic.
func (*Version) Descriptor ¶
func (*Version) ProtoMessage ¶
func (*Version) ProtoMessage()
func (*Version) XXX_DiscardUnknown ¶ added in v0.3.1
func (m *Version) XXX_DiscardUnknown()
func (*Version) XXX_Marshal ¶ added in v0.3.1
func (*Version) XXX_Unmarshal ¶ added in v0.3.1
Directories
¶
| Path | Synopsis |
|---|---|
|
gnostic_analyze is a tool for analyzing OpenAPI descriptions.
|
gnostic_analyze is a tool for analyzing OpenAPI descriptions. |
|
summarize
command
summarize is a tool for summarizing the results of gnostic_analyze runs.
|
summarize is a tool for summarizing the results of gnostic_analyze runs. |
|
gnostic-plugin-request is a development tool that captures and optionally displays the contents of the gnostic plugin interface.
|
gnostic-plugin-request is a development tool that captures and optionally displays the contents of the gnostic plugin interface. |
|
gnostic-process-plugin-response is a development tool that processes the output of a gnostic plugin in the same way that it would be handled by gnostic itself.
|
gnostic-process-plugin-response is a development tool that processes the output of a gnostic plugin in the same way that it would be handled by gnostic itself. |
|
gnostic_go_generator is a sample Gnostic plugin that generates Go code that supports an API.
|
gnostic_go_generator is a sample Gnostic plugin that generates Go code that supports an API. |
Click to show internal directories.
Click to hide internal directories.