package surface_v1
import "github.com/google/gnostic/surface"
Package surface_v1 is a generated protocol buffer package.
It is generated from these files:
surface.proto
It has these top-level messages:
Field Type Method Model
Index ¶
- Variables
- type Field
- func (*Field) Descriptor() ([]byte, []int)
- func (m *Field) GetFieldName() string
- func (m *Field) GetFormat() string
- func (m *Field) GetKind() FieldKind
- func (m *Field) GetName() string
- func (m *Field) GetNativeType() string
- func (m *Field) GetParameterName() string
- func (m *Field) GetPosition() Position
- func (m *Field) GetSerialize() bool
- func (m *Field) GetType() string
- func (*Field) ProtoMessage()
- func (m *Field) Reset()
- func (f *Field) ServiceType(m *Model) *Type
- func (m *Field) String() string
- type FieldKind
- type Method
- func (*Method) Descriptor() ([]byte, []int)
- func (m *Method) GetClientName() string
- func (m *Method) GetDescription() string
- func (m *Method) GetHandlerName() string
- func (m *Method) GetMethod() string
- func (m *Method) GetName() string
- func (m *Method) GetOperation() string
- func (m *Method) GetParametersTypeName() string
- func (m *Method) GetPath() string
- func (m *Method) GetProcessorName() string
- func (m *Method) GetResponsesTypeName() string
- func (*Method) ProtoMessage()
- func (m *Method) Reset()
- func (m *Method) String() string
- type Model
- func NewModelFromOpenAPI2(document *openapiv2.Document) (*Model, error)
- func NewModelFromOpenAPI3(document *openapiv3.Document) (*Model, error)
- func (*Model) Descriptor() ([]byte, []int)
- func (m *Model) GetMethods() []*Method
- func (m *Model) GetName() string
- func (m *Model) GetTypes() []*Type
- func (*Model) ProtoMessage()
- func (m *Model) Reset()
- func (m *Model) String() string
- func (m *Model) TypeWithTypeName(name string) *Type
- type OpenAPI2Builder
- type OpenAPI3Builder
- type Position
- type Type
- func (*Type) Descriptor() ([]byte, []int)
- func (s *Type) FieldWithName(name string) *Field
- func (s *Type) FieldWithPosition(position Position) *Field
- func (m *Type) GetContentType() string
- func (m *Type) GetDescription() string
- func (m *Type) GetFields() []*Field
- func (m *Type) GetKind() TypeKind
- func (m *Type) GetName() string
- func (m *Type) GetTypeName() string
- func (s *Type) HasFieldWithName(name string) bool
- func (s *Type) HasFieldWithPosition(position Position) bool
- func (*Type) ProtoMessage()
- func (m *Type) Reset()
- func (m *Type) String() string
- type TypeKind
Variables ¶
var FieldKind_name = map[int32]string{ 0: "SCALAR", 1: "MAP", 2: "ARRAY", 3: "REFERENCE", 4: "ANY", }
var FieldKind_value = map[string]int32{ "SCALAR": 0, "MAP": 1, "ARRAY": 2, "REFERENCE": 3, "ANY": 4, }
var Position_name = map[int32]string{ 0: "BODY", 1: "HEADER", 2: "FORMDATA", 3: "QUERY", 4: "PATH", }
var Position_value = map[string]int32{ "BODY": 0, "HEADER": 1, "FORMDATA": 2, "QUERY": 3, "PATH": 4, }
Types ¶
type Field ¶
type Field struct { Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Type string `protobuf:"bytes,2,opt,name=type" json:"type,omitempty"` Kind FieldKind `protobuf:"varint,3,opt,name=kind,enum=surface.v1.FieldKind" json:"kind,omitempty"` Format string `protobuf:"bytes,4,opt,name=format" json:"format,omitempty"` Position Position `protobuf:"varint,5,opt,name=position,enum=surface.v1.Position" json:"position,omitempty"` NativeType string `protobuf:"bytes,6,opt,name=nativeType" json:"nativeType,omitempty"` FieldName string `protobuf:"bytes,7,opt,name=fieldName" json:"fieldName,omitempty"` ParameterName string `protobuf:"bytes,8,opt,name=parameterName" json:"parameterName,omitempty"` Serialize bool `protobuf:"varint,9,opt,name=serialize" json:"serialize,omitempty"` }
Field is a field in a definition and can be associated with a position in a request structure.
func (*Field) Descriptor ¶
func (*Field) GetFieldName ¶
func (*Field) GetFormat ¶
func (*Field) GetKind ¶
func (*Field) GetName ¶
func (*Field) GetNativeType ¶
func (*Field) GetParameterName ¶
func (*Field) GetPosition ¶
func (*Field) GetSerialize ¶
func (*Field) GetType ¶
func (*Field) ProtoMessage ¶
func (*Field) ProtoMessage()
func (*Field) Reset ¶
func (m *Field) Reset()
func (*Field) ServiceType ¶
ServiceType returns the Type associated with a field.
func (*Field) String ¶
type FieldKind ¶
type FieldKind int32
const ( FieldKind_SCALAR FieldKind = 0 FieldKind_MAP FieldKind = 1 FieldKind_ARRAY FieldKind = 2 FieldKind_REFERENCE FieldKind = 3 FieldKind_ANY FieldKind = 4 )
func (FieldKind) EnumDescriptor ¶
func (FieldKind) String ¶
type Method ¶
type Method struct { Operation string `protobuf:"bytes,1,opt,name=operation" json:"operation,omitempty"` Path string `protobuf:"bytes,2,opt,name=path" json:"path,omitempty"` Method string `protobuf:"bytes,3,opt,name=method" json:"method,omitempty"` Description string `protobuf:"bytes,4,opt,name=description" json:"description,omitempty"` Name string `protobuf:"bytes,5,opt,name=name" json:"name,omitempty"` HandlerName string `protobuf:"bytes,6,opt,name=handlerName" json:"handlerName,omitempty"` ProcessorName string `protobuf:"bytes,7,opt,name=processorName" json:"processorName,omitempty"` ClientName string `protobuf:"bytes,8,opt,name=clientName" json:"clientName,omitempty"` ParametersTypeName string `protobuf:"bytes,9,opt,name=parametersTypeName" json:"parametersTypeName,omitempty"` ResponsesTypeName string `protobuf:"bytes,10,opt,name=responsesTypeName" json:"responsesTypeName,omitempty"` }
Method is an operation of an API and typically has associated client and server code.
func (*Method) Descriptor ¶
func (*Method) GetClientName ¶
func (*Method) GetDescription ¶
func (*Method) GetHandlerName ¶
func (*Method) GetMethod ¶
func (*Method) GetName ¶
func (*Method) GetOperation ¶
func (*Method) GetParametersTypeName ¶
func (*Method) GetPath ¶
func (*Method) GetProcessorName ¶
func (*Method) GetResponsesTypeName ¶
func (*Method) ProtoMessage ¶
func (*Method) ProtoMessage()
func (*Method) Reset ¶
func (m *Method) Reset()
func (*Method) String ¶
type Model ¶
type Model struct { Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Types []*Type `protobuf:"bytes,2,rep,name=types" json:"types,omitempty"` Methods []*Method `protobuf:"bytes,3,rep,name=methods" json:"methods,omitempty"` }
Model represents an API for code generation.
func NewModelFromOpenAPI2 ¶
NewModelFromOpenAPI2 builds a model of an API service for use in code generation.
func NewModelFromOpenAPI3 ¶
NewModelFromOpenAPIv3 builds a model of an API service for use in code generation.
func (*Model) Descriptor ¶
func (*Model) GetMethods ¶
func (*Model) GetName ¶
func (*Model) GetTypes ¶
func (*Model) ProtoMessage ¶
func (*Model) ProtoMessage()
func (*Model) Reset ¶
func (m *Model) Reset()
func (*Model) String ¶
func (*Model) TypeWithTypeName ¶
type OpenAPI2Builder ¶
type OpenAPI2Builder struct {
// contains filtered or unexported fields
}
type OpenAPI3Builder ¶
type OpenAPI3Builder struct {
// contains filtered or unexported fields
}
type Position ¶
type Position int32
const ( Position_BODY Position = 0 Position_HEADER Position = 1 Position_FORMDATA Position = 2 Position_QUERY Position = 3 Position_PATH Position = 4 )
func (Position) EnumDescriptor ¶
func (Position) String ¶
type Type ¶
type Type struct { Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Kind TypeKind `protobuf:"varint,2,opt,name=kind,enum=surface.v1.TypeKind" json:"kind,omitempty"` Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` ContentType string `protobuf:"bytes,4,opt,name=contentType" json:"contentType,omitempty"` Fields []*Field `protobuf:"bytes,5,rep,name=fields" json:"fields,omitempty"` TypeName string `protobuf:"bytes,6,opt,name=typeName" json:"typeName,omitempty"` }
Type typically corresponds to a definition, parameter, or response in an API and is represented by a type in generated code.
func (*Type) Descriptor ¶
func (*Type) FieldWithName ¶
func (*Type) FieldWithPosition ¶
func (*Type) GetContentType ¶
func (*Type) GetDescription ¶
func (*Type) GetFields ¶
func (*Type) GetKind ¶
func (*Type) GetName ¶
func (*Type) GetTypeName ¶
func (*Type) HasFieldWithName ¶
func (*Type) HasFieldWithPosition ¶
func (*Type) ProtoMessage ¶
func (*Type) ProtoMessage()
func (*Type) Reset ¶
func (m *Type) Reset()
func (*Type) String ¶
type TypeKind ¶
type TypeKind int32
func (TypeKind) EnumDescriptor ¶
func (TypeKind) String ¶
Source Files ¶
field.go model.go model_openapiv2.go model_openapiv3.go surface.pb.go type.go
- Version
- v0.3.0
- Published
- Jun 13, 2019
- Platform
- js/wasm
- Imports
- 9 packages
- Last checked
- 2 hours ago –
Tools for package owners.