Documentation ¶
Overview ¶
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
- 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
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" 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) 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.
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) GetOperation ¶
func (*Method) GetParametersTypeName ¶
func (*Method) GetProcessorName ¶
func (*Method) GetResponsesTypeName ¶
func (*Method) ProtoMessage ¶
func (*Method) ProtoMessage()
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) ProtoMessage ¶
func (*Model) ProtoMessage()
func (*Model) TypeWithTypeName ¶
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" 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) GetTypeName ¶
func (*Type) HasFieldWithName ¶
func (*Type) HasFieldWithPosition ¶
func (*Type) ProtoMessage ¶
func (*Type) ProtoMessage()