Documentation
¶
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
- func (m *Field) XXX_DiscardUnknown()
- func (m *Field) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Field) XXX_Merge(src proto.Message)
- func (m *Field) XXX_Size() int
- func (m *Field) XXX_Unmarshal(b []byte) error
- type FieldInfo
- 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
- func (m *Method) XXX_DiscardUnknown()
- func (m *Method) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Method) XXX_Merge(src proto.Message)
- func (m *Method) XXX_Size() int
- func (m *Method) XXX_Unmarshal(b []byte) error
- type Model
- func (*Model) Descriptor() ([]byte, []int)
- func (m *Model) GetMethods() []*Method
- func (m *Model) GetName() string
- func (m *Model) GetSymbolicReferences() []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
- func (m *Model) XXX_DiscardUnknown()
- func (m *Model) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Model) XXX_Merge(src proto.Message)
- func (m *Model) XXX_Size() int
- func (m *Model) XXX_Unmarshal(b []byte) error
- 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
- func (m *Type) XXX_DiscardUnknown()
- func (m *Type) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Type) XXX_Merge(src proto.Message)
- func (m *Type) XXX_Size() int
- func (m *Type) XXX_Unmarshal(b []byte) error
- type TypeKind
Constants ¶
This section is empty.
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,
}
var TypeKind_name = map[int32]string{
0: "STRUCT",
1: "OBJECT",
}
var TypeKind_value = map[string]int32{
"STRUCT": 0,
"OBJECT": 1,
}
Functions ¶
This section is empty.
Types ¶
type Field ¶
type Field struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` Kind FieldKind `protobuf:"varint,3,opt,name=kind,proto3,enum=surface.v1.FieldKind" json:"kind,omitempty"` Format string `protobuf:"bytes,4,opt,name=format,proto3" json:"format,omitempty"` Position Position `protobuf:"varint,5,opt,name=position,proto3,enum=surface.v1.Position" json:"position,omitempty"` NativeType string `protobuf:"bytes,6,opt,name=native_type,json=nativeType,proto3" json:"native_type,omitempty"` FieldName string `protobuf:"bytes,7,opt,name=field_name,json=fieldName,proto3" json:"field_name,omitempty"` ParameterName string `protobuf:"bytes,8,opt,name=parameter_name,json=parameterName,proto3" json:"parameter_name,omitempty"` Serialize bool `protobuf:"varint,9,opt,name=serialize,proto3" json:"serialize,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
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) GetNativeType ¶
func (*Field) GetParameterName ¶
func (*Field) GetPosition ¶
func (*Field) GetSerialize ¶
func (*Field) ProtoMessage ¶
func (*Field) ProtoMessage()
func (*Field) ServiceType ¶
ServiceType returns the Type associated with a field.
func (*Field) XXX_DiscardUnknown ¶ added in v0.4.0
func (m *Field) XXX_DiscardUnknown()
func (*Field) XXX_Marshal ¶ added in v0.4.0
func (*Field) XXX_Unmarshal ¶ added in v0.4.0
type FieldInfo ¶ added in v0.4.0
type FieldInfo struct {
// contains filtered or unexported fields
}
The structure to transport information during the recursive calls inside model_openapiv2.go and model_openapiv3.go
type Method ¶
type Method struct { Operation string `protobuf:"bytes,1,opt,name=operation,proto3" json:"operation,omitempty"` Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` Method string `protobuf:"bytes,3,opt,name=method,proto3" json:"method,omitempty"` Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` HandlerName string `protobuf:"bytes,6,opt,name=handler_name,json=handlerName,proto3" json:"handler_name,omitempty"` ProcessorName string `protobuf:"bytes,7,opt,name=processor_name,json=processorName,proto3" json:"processor_name,omitempty"` ClientName string `protobuf:"bytes,8,opt,name=client_name,json=clientName,proto3" json:"client_name,omitempty"` ParametersTypeName string `protobuf:"bytes,9,opt,name=parameters_type_name,json=parametersTypeName,proto3" json:"parameters_type_name,omitempty"` ResponsesTypeName string `protobuf:"bytes,10,opt,name=responses_type_name,json=responsesTypeName,proto3" json:"responses_type_name,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
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) GetOperation ¶
func (*Method) GetParametersTypeName ¶
func (*Method) GetProcessorName ¶
func (*Method) GetResponsesTypeName ¶
func (*Method) ProtoMessage ¶
func (*Method) ProtoMessage()
func (*Method) XXX_DiscardUnknown ¶ added in v0.4.0
func (m *Method) XXX_DiscardUnknown()
func (*Method) XXX_Marshal ¶ added in v0.4.0
func (*Method) XXX_Unmarshal ¶ added in v0.4.0
type Model ¶
type Model struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Types []*Type `protobuf:"bytes,2,rep,name=types,proto3" json:"types,omitempty"` Methods []*Method `protobuf:"bytes,3,rep,name=methods,proto3" json:"methods,omitempty"` SymbolicReferences []string `protobuf:"bytes,4,rep,name=symbolic_references,json=symbolicReferences,proto3" json:"symbolic_references,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
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) GetSymbolicReferences ¶ added in v0.4.0
func (*Model) ProtoMessage ¶
func (*Model) ProtoMessage()
func (*Model) TypeWithTypeName ¶
func (*Model) XXX_DiscardUnknown ¶ added in v0.4.0
func (m *Model) XXX_DiscardUnknown()
func (*Model) XXX_Marshal ¶ added in v0.4.0
func (*Model) XXX_Unmarshal ¶ added in v0.4.0
type OpenAPI2Builder ¶
type OpenAPI2Builder struct {
// contains filtered or unexported fields
}
type OpenAPI3Builder ¶
type OpenAPI3Builder struct {
// contains filtered or unexported fields
}
type Type ¶
type Type struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Kind TypeKind `protobuf:"varint,2,opt,name=kind,proto3,enum=surface.v1.TypeKind" json:"kind,omitempty"` Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` ContentType string `protobuf:"bytes,4,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"` Fields []*Field `protobuf:"bytes,5,rep,name=fields,proto3" json:"fields,omitempty"` TypeName string `protobuf:"bytes,6,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
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) GetTypeName ¶
func (*Type) HasFieldWithName ¶
func (*Type) HasFieldWithPosition ¶
func (*Type) ProtoMessage ¶
func (*Type) ProtoMessage()
func (*Type) XXX_DiscardUnknown ¶ added in v0.4.0
func (m *Type) XXX_DiscardUnknown()