Documentation ¶
Index ¶
- Constants
- Variables
- func CovertSwaggerMethordToLocalMethord(schema *registry.SchemaContent, src *registry.MethodInfo, dst *DefMethod)
- func GetSupportProto(svc *registry.MicroService) string
- func GetSvcByInterface(interfaceName string) *registry.MicroService
- func GetSvcNameByInterface(interfaceName string) string
- type DefField
- type DefMethod
- func GetMethodByInterface(interfaceName string, operateID string) *DefMethod
- func GetMethodInfoSchemaByURL(schema *registry.SchemaContent, verb string, url string) *DefMethod
- func GetSchemaMethodBySvcURL(svcName string, env string, ver string, app string, verb string, url string) (*registry.SchemaContent, *DefMethod)
- type DefType
- type InterfaceSchema
- type Job
- type JobFunc
- type MethParam
- type MethRespond
- type Queue
Constants ¶
const ( InQuery = 0 InBody = 1 )
Variables ¶
var ( //DefaultInterval is default refresh interval time DefaultInterval = 30 * time.Second //DefaultExpireTime is default expire time DefaultExpireTime = 0 * time.Second )
Functions ¶
func CovertSwaggerMethordToLocalMethord ¶
func CovertSwaggerMethordToLocalMethord(schema *registry.SchemaContent, src *registry.MethodInfo, dst *DefMethod)
CovertSwaggerMethordToLocalMethord is a function to convert swagger method to local method
func GetSupportProto ¶
func GetSupportProto(svc *registry.MicroService) string
GetSupportProto is a function to get supported protocol
func GetSvcByInterface ¶
func GetSvcByInterface(interfaceName string) *registry.MicroService
GetSvcByInterface is a function to get service by interface name
func GetSvcNameByInterface ¶
GetSvcNameByInterface is a function to get service name by interface
Types ¶
type DefField ¶
type DefField struct {
// contains filtered or unexported fields
}
DefField is a struct
type DefMethod ¶
type DefMethod struct { Path string // 样例: /test/StringArray 需要是包含basepath的URL OperaID string Paras []MethParam //key 参数名称 Verb string // get post ... Responds map[string]*MethRespond //key 为返回码 200 ,404... // contains filtered or unexported fields }
DefMethod is a struct
func GetMethodByInterface ¶
GetMethodByInterface is a function to get method from interface name
func GetMethodInfoSchemaByURL ¶
func GetMethodInfoSchemaByURL(schema *registry.SchemaContent, verb string, url string) *DefMethod
GetMethodInfoSchemaByURL is a function to get method info schema from URl
func GetSchemaMethodBySvcURL ¶
func GetSchemaMethodBySvcURL(svcName string, env string, ver string, app string, verb string, url string) (*registry.SchemaContent, *DefMethod)
GetSchemaMethodBySvcURL is a function to get schema method from URl
func (*DefMethod) GetParamNameAndWhere ¶
GetParamNameAndWhere is a method to get parameter name
func (*DefMethod) GetParamSchema ¶
GetParamSchema is a method to get parameter schema
func (*DefMethod) GetRspSchema ¶
func (this *DefMethod) GetRspSchema(status int) *MethRespond
GetRspSchema is a method to get response schema
type DefType ¶
type DefType struct { JvmClsName string // contains filtered or unexported fields }
DefType 契约definitions字段里定义的类型定义
func GetDefTypeFromDef ¶
func GetDefTypeFromDef(defs map[string]registry.Definition, ref string) DefType
GetDefTypeFromDef is a function to get defintion type
type InterfaceSchema ¶
type InterfaceSchema struct { SvcName string JavaClsName string BasePath string Version string AppId string ServiceId string // contains filtered or unexported fields }
InterfaceSchema is a struct
type MethParam ¶
type MethParam struct { Name string //参数名称 Dtype string //参数类型 AdditionalProps map[string]string //附加参数,如果是Dtype是map,则在这里定义value类型 Items map[string]string //当Dtype为array时使用 Required bool //是否必需 Where string //存储位置 query or body Indx int ObjRef DefType }
MethParam is a struct
type MethRespond ¶
MethRespond is a struct