Documentation
¶
Index ¶
- type APIDoc
- type APINamespace
- type APISchema
- type APISchemaOper
- type APIService
- type APIStatOper
- type AppCenterServerOper
- type CheckAuthReq
- type CheckAuthResp
- type CreateNsReq
- type CreateRawPolyReq
- type CreateRawPolyResp
- type DelReq
- type DelResp
- type DeleteByPolyAPIInBatchesReq
- type DeleteByPolyAPIInBatchesResp
- type DeleteByPolyAPIReq
- type DeleteByPolyAPIResp
- type DeleteByRawAPIReq
- type DeleteByRawAPIResp
- type DeleteCustomerKeyByPrefixReq
- type DeleteCustomerKeyByPrefixResp
- type DeleteCustomerKeyInBatchReq
- type DeleteCustomerKeyInBatchResp
- type DeleteNsReq
- type DeleteNsResp
- type DeleteServiceReq
- type DeleteServiceResp
- type EvalerOper
- type FileServerOper
- type InnerDelNsByPrefixPathReq
- type InnerDelNsByPrefixPathResp
- type InnerDelPolyByPrefixPathReq
- type InnerDelPolyByPrefixPathResp
- type InnerDelRawByPrefixPathReq
- type InnerDelRawByPrefixPathResp
- type InnerDelRawPolyByPrefixPathReq
- type InnerDelRawPolyByPrefixPathResp
- type InnerDelServiceByPrefixPathReq
- type InnerDelServiceByPrefixPathResp
- type InnerDeleteServiceReq
- type InnerDeleteServiceResp
- type InnerImportNsReq
- type InnerImportNsResp
- type InnerImportPolyReq
- type InnerImportPolyResp
- type InnerImportRawPolyReq
- type InnerImportRawPolyResp
- type InnerImportRawReq
- type InnerImportRawResp
- type InnerImportServiceReq
- type InnerImportServiceResp
- type InnerUpdateRawInBatchReq
- type InnerUpdateRawInBatchResp
- type Instances
- type KMSAuthorizeResp
- type KMSAuthorizeRespItem
- type KMSCustomerKey
- type KMSOper
- type ListInServiceReq
- type ListInServiceResp
- type ListKMSCustomerKeyReq
- type ListKMSCustomerKeyResp
- type ListNsByPrefixPathReq
- type ListNsByPrefixPathResp
- type ListNsReq
- type ListNsResp
- type ListPolyByPrefixPathReq
- type ListPolyByPrefixPathResp
- type ListRawByPrefixPathReq
- type ListRawByPrefixPathResp
- type ListRawPolyByPrefixPathReq
- type ListRawPolyByPrefixPathResp
- type ListServiceByPrefixReq
- type ListServiceByPrefixResp
- type ListServiceReq
- type ListServiceResp
- type NamespaceOper
- type NamespaceResp
- type Operation
- type PolyAPIFull
- type PolyAPIOper
- type PolyDeleteReq
- type PolyDeleteResp
- type PolyListNode
- type PolyListReq
- type PolyListResp
- type PolyValidByPrefixPathReq
- type PolyValidByPrefixPathResp
- type PolyValidInBatchesReq
- type PolyValidInBatchesResp
- type QueryByPolyAPIReq
- type QueryByPolyAPIResp
- type QueryByRawAPIReq
- type QueryByRawAPIResp
- type QueryKMSCustomerKeyResp
- type QueryPolySwaggerReq
- type QueryPolySwaggerResp
- type QueryRawAPIInBatchesReq
- type QueryRawAPIInBatchesResp
- type QueryRawAPIReq
- type QueryRawAPIResp
- type QueryRawPolyResp
- type QueryRawSwaggerReq
- type QueryRawSwaggerResp
- type RawAPIContent
- type RawAPIFull
- type RawAPIOper
- type RawListNode
- type RawListReq
- type RawListResp
- type RawPoly
- type RawPolyOper
- type RawPolyResp
- type RawValidByPrefixPathReq
- type RawValidByPrefixPathResp
- type RawValidInBatchesReq
- type RawValidInBatchesResp
- type Schema
- type ServiceOper
- type ServicesResp
- type UpdateCustomerKeyInBatchReq
- type UpdateCustomerKeyInBatchResp
- type UpdateNsReq
- type UpdateNsResp
- type UpdateNsValidReq
- type UpdateNsValidResp
- type UpdateRawPolyReq
- type UpdateRawPolyResp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIDoc ¶
type APIDoc struct { ID string `json:"x-id"` Version string `json:"version"` FmtInOut expr.FmtAPIInOut `json:"x-fmt-inout"` // formated input and output Swagger json.RawMessage `json:"x-swagger"` Defines json.RawMessage `json:"defines,omitempty"` // swag format SecurityDefinitions json.RawMessage `json:"securityDefinitions,omitempty"` // swag format Security json.RawMessage `json:"security,omitempty"` // swag format Parameters json.RawMessage `json:"parameters,omitempty"` // swag format Responses json.RawMessage `json:"responses,omitempty"` // swag format }
APIDoc is the api doc schema
type APINamespace ¶
type APINamespace struct { ID string Owner string OwnerName string Parent string Namespace string SubCount uint Title string Desc string Access uint Active uint Valid uint CreateAt int64 UpdateAt int64 DeleteAt *int64 FullPath string `json:"-" gorm:"-"` }
APINamespace Schema Objects
type APISchema ¶
type APISchema struct { ID string `json:"id"` Namespace string `json:"namespace"` Service string `json:"service"` Name string `json:"name"` Title string `json:"title"` Desc string `json:"desc"` CreateAt int64 `json:"createAt"` UpdateAt int64 `json:"updateAt"` }
APISchema APISchema
type APISchemaOper ¶
type APISchemaOper interface { }
APISchemaOper is the interface for api schema operator
type APIService ¶
type APIService struct { ID string Owner string OwnerName string Namespace string Name string Title string Desc string Access uint Active uint Schema string Host string AuthType string Authorize string CreateAt int64 UpdateAt int64 DeleteAt *int64 }
APIService Schema Objects
type APIStatOper ¶
type APIStatOper interface { IncTimeStat(c context.Context, apiPath string, raw bool, dur time.Duration) error // GetStat(c context.Context, apiPath string, raw bool) (int64, error) IsBlocked(c context.Context, apiPath string, raw bool) bool }
APIStatOper is the interface for api stat
func GetAPIStatOper ¶
func GetAPIStatOper() APIStatOper
GetAPIStatOper get the instance of api stat oper
func SetAPIStatOper ¶
func SetAPIStatOper(f APIStatOper) APIStatOper
SetAPIStatOper set the instance of api stat oper
type AppCenterServerOper ¶
type AppCenterServerOper interface {
Check(c context.Context, userID, depID, appID string, isSuper, admin bool) (bool, error)
}
AppCenterServerOper is the interface for app-center server proxy
func GetAppCenterServerOper ¶
func GetAppCenterServerOper() AppCenterServerOper
GetAppCenterServerOper get the instance of app-center server oper
func SetAppCenterServerOper ¶
func SetAppCenterServerOper(c AppCenterServerOper) AppCenterServerOper
SetAppCenterServerOper set the instance of app-center server oper
type CheckAuthReq ¶
type CheckAuthReq struct { AuthType string `json:"authType"` ServicePath string `json:"servicePath"` AuthContent string `json:"authContent"` }
CheckAuthReq CheckAuthReq
type CreateNsReq ¶
type CreateNsReq struct { Owner string `json:"-"` OwnerName string `json:"-"` IgnoreAccessCheck bool `json:"-"` // NOTE: launch by inner Namespace string `uri:"namespace"` Name string `json:"name" binding:"max=64"` Title string `json:"title"` Desc string `json:"desc"` }
CreateNsReq CreateNsReq
type CreateRawPolyReq ¶
type CreateRawPolyReq struct { PolyAPI string `json:"polyAPI"` RawAPIList []string `json:"rawAPIList"` }
CreateRawPolyReq CreateRawPolyReq
type DelReq ¶
type DelReq struct { NamespacePath string `json:"-" binding:"-"` // Names []string `json:"names"` Owner string `json:"-"` }
DelReq DelReq
type DeleteByPolyAPIInBatchesReq ¶
type DeleteByPolyAPIInBatchesReq struct {
PolyAPIPath []string `json:"polyAPIPath"`
}
DeleteByPolyAPIInBatchesReq DeleteByPolyAPIInBatchesReq
type DeleteByPolyAPIInBatchesResp ¶
type DeleteByPolyAPIInBatchesResp struct { }
DeleteByPolyAPIInBatchesResp DeleteByPolyAPIInBatchesResp
type DeleteByPolyAPIReq ¶
type DeleteByPolyAPIReq struct {
PolyAPI string `json:"polyAPI"`
}
DeleteByPolyAPIReq DeleteByPolyAPIReq
type DeleteByPolyAPIResp ¶
type DeleteByPolyAPIResp struct{}
DeleteByPolyAPIResp DeleteByPolyAPIResp
type DeleteByRawAPIReq ¶
type DeleteByRawAPIReq struct {
RawAPI string `json:"rawAPI"`
}
DeleteByRawAPIReq DeleteByRawAPIReq
type DeleteCustomerKeyByPrefixReq ¶
type DeleteCustomerKeyByPrefixReq struct {
NamespacePath string `json:"namespacePath"`
}
DeleteCustomerKeyByPrefixReq DeleteCustomerKeyByPrefixReq
type DeleteCustomerKeyByPrefixResp ¶
type DeleteCustomerKeyByPrefixResp struct { }
DeleteCustomerKeyByPrefixResp DeleteCustomerKeyByPrefixResp
type DeleteCustomerKeyInBatchReq ¶
type DeleteCustomerKeyInBatchReq struct { Namespace string `json:"namespace"` ServiceName []string `json:"serviceName"` }
DeleteCustomerKeyInBatchReq DeleteCustomerKeyInBatchReq
type DeleteCustomerKeyInBatchResp ¶
type DeleteCustomerKeyInBatchResp struct { }
DeleteCustomerKeyInBatchResp DeleteCustomerKeyInBatchResp
type DeleteNsReq ¶
type DeleteNsReq struct { NamespacePath string `json:"-"` Owner string `json:"-"` Pointer *APINamespace `json:"-"` ForceDelAPI bool `json:"forceDelAPI"` }
DeleteNsReq DeleteNsReq
type DeleteNsResp ¶
type DeleteNsResp struct {
FullPath string `json:"fullPath"`
}
DeleteNsResp DeleteNsResp
type DeleteServiceReq ¶
DeleteServiceReq DeleteServiceReq
type DeleteServiceResp ¶
type DeleteServiceResp struct {
FullPath string `json:"fullPath"`
}
DeleteServiceResp DelteServiceResp
type EvalerOper ¶
EvalerOper if Evaler creater
func SetEvalerOper ¶
func SetEvalerOper(f EvalerOper) EvalerOper
SetEvalerOper set the instance of Evaler oper
type FileServerOper ¶
type FileServerOper interface { // UploadFile upload a file to file server UploadFile(c context.Context, filename string, content []byte) (string, error) }
FileServerOper is the interface for file server proxy
func GetFileServerOper ¶
func GetFileServerOper() FileServerOper
GetFileServerOper get the instance of file server oper
func SetFileServerOper ¶
func SetFileServerOper(f FileServerOper) FileServerOper
SetFileServerOper set the instance of file server oper
type InnerDelNsByPrefixPathReq ¶
type InnerDelNsByPrefixPathReq struct {
NamespacePath string `json:"-"`
}
InnerDelNsByPrefixPathReq InnerDelNsByPrefixPathReq
type InnerDelNsByPrefixPathResp ¶
type InnerDelNsByPrefixPathResp struct { }
InnerDelNsByPrefixPathResp InnerDelNsByPrefixPathResp
type InnerDelPolyByPrefixPathReq ¶
type InnerDelPolyByPrefixPathReq struct {
NamespacePath string `json:"-"`
}
InnerDelPolyByPrefixPathReq InnerDelPolyByPrefixPathReq
type InnerDelPolyByPrefixPathResp ¶
type InnerDelPolyByPrefixPathResp struct { }
InnerDelPolyByPrefixPathResp InnerDelPolyByPrefixPathResp
type InnerDelRawByPrefixPathReq ¶
type InnerDelRawByPrefixPathReq struct {
NamespacePath string `json:"-"`
}
InnerDelRawByPrefixPathReq InnerDelRawByPrefixPathReq
type InnerDelRawByPrefixPathResp ¶
type InnerDelRawByPrefixPathResp struct { }
InnerDelRawByPrefixPathResp InnerDelRawByPrefixPathResp
type InnerDelRawPolyByPrefixPathReq ¶
type InnerDelRawPolyByPrefixPathReq struct {
NamespacePath string `json:"-"`
}
InnerDelRawPolyByPrefixPathReq InnerDelRawPolyByPrefixPathReq
type InnerDelRawPolyByPrefixPathResp ¶
type InnerDelRawPolyByPrefixPathResp struct { }
InnerDelRawPolyByPrefixPathResp InnerDelRawPolyByPrefixPathResp
type InnerDelServiceByPrefixPathReq ¶
type InnerDelServiceByPrefixPathReq struct {
NamespacePath string `json:"-"`
}
InnerDelServiceByPrefixPathReq InnerDelServiceByPrefixPathReq
type InnerDelServiceByPrefixPathResp ¶
type InnerDelServiceByPrefixPathResp struct { }
InnerDelServiceByPrefixPathResp InnerDelServiceByPrefixPathResp
type InnerDeleteServiceReq ¶
InnerDeleteServiceReq InnerDeleteServiceReq
type InnerDeleteServiceResp ¶
type InnerDeleteServiceResp struct { }
InnerDeleteServiceResp InnerDeleteServiceResp
type InnerImportNsReq ¶
type InnerImportNsReq struct {
List []*APINamespace `json:"list"`
}
InnerImportNsReq InnerImportNsReq
type InnerImportPolyReq ¶
type InnerImportPolyReq struct {
List []*PolyAPIFull `json:"list"`
}
InnerImportPolyReq InnerImportPolyReq
type InnerImportPolyResp ¶
type InnerImportPolyResp struct { }
InnerImportPolyResp InnerImportPolyResp
type InnerImportRawPolyReq ¶
type InnerImportRawPolyReq struct {
List []*RawPoly `json:"list"`
}
InnerImportRawPolyReq InnerImportRawPolyReq
type InnerImportRawPolyResp ¶
type InnerImportRawPolyResp struct { }
InnerImportRawPolyResp InnerImportRawPolyResp
type InnerImportRawReq ¶
type InnerImportRawReq struct {
List []*RawAPIFull `json:"list"`
}
InnerImportRawReq InnerImportRawReq
type InnerImportServiceReq ¶
type InnerImportServiceReq struct {
List []*APIService `json:"list"`
}
InnerImportServiceReq InnerImportServiceReq
type InnerImportServiceResp ¶
type InnerImportServiceResp struct { }
InnerImportServiceResp InnerImportServiceResp
type InnerUpdateRawInBatchReq ¶
type InnerUpdateRawInBatchReq struct { Namespace string `json:"namespace"` Service string `json:"service"` Host string `json:"host"` Schema string `json:"schema"` AuthType string `json:"authType"` }
InnerUpdateRawInBatchReq InnerUpdateRawInBatchReq
type InnerUpdateRawInBatchResp ¶
type InnerUpdateRawInBatchResp struct { }
InnerUpdateRawInBatchResp InnerUpdateRawInBatchResp
type Instances ¶
type Instances struct {
// contains filtered or unexported fields
}
Instances manage the instances of adaptors
type KMSAuthorizeResp ¶
type KMSAuthorizeResp struct {
Token []*KMSAuthorizeRespItem `json:"token"`
}
KMSAuthorizeResp KMSAuthorizeResp
type KMSAuthorizeRespItem ¶
type KMSAuthorizeRespItem struct { In string `json:"in"` Name string `json:"name"` Value string `json:"value"` }
KMSAuthorizeRespItem KMSAuthorizeRespItem
type KMSCustomerKey ¶
type KMSCustomerKey struct { ID string `json:"id"` //unique id Owner string `json:"owner"` //owner id OwnerName string `json:"ownerName"` Name string `json:"name"` Title string `json:"title"` Description string `json:"description"` Service string `json:"service"` //belong service, eg: system_form Host string `json:"host"` //service host, eg: api.xxx.com:8080 AuthType string `json:"authType"` //signature/cookie/oauth2... AuthContent string `json:"authContent"` //Authorize detail KeyID string `json:"keyID"` //key id KeyContent string `json:"keyContent"` //key content Active int `json:"active"` //1 active 0 disable CreateAt int64 `json:"createAt"` //create time UpdateAt int64 `json:"updateAt"` //update time }
KMSCustomerKey key info except secret
type KMSOper ¶
type KMSOper interface { // Authorize request third party token by key Authorize(c context.Context, keyUUID string, body json.RawMessage, header http.Header) (*KMSAuthorizeResp, error) ListCustomerAPIKey(c context.Context, req *ListKMSCustomerKeyReq) (*ListKMSCustomerKeyResp, error) QueryCustomerAPIKey(c context.Context, keyUUID string) (*QueryKMSCustomerKeyResp, error) UpdateCustomerKeyInBatch(c context.Context, req *UpdateCustomerKeyInBatchReq) (*UpdateCustomerKeyInBatchResp, error) DeleteCustomerKeyInBatch(c context.Context, req *DeleteCustomerKeyInBatchReq) (*DeleteCustomerKeyInBatchResp, error) DeleteCustomerKeyByPrefix(c context.Context, req *DeleteCustomerKeyByPrefixReq) (*DeleteCustomerKeyByPrefixResp, error) CheckAuth(c context.Context, req *CheckAuthReq) (*CheckAuthResp, error) }
KMSOper is the interface for kms proxy
type ListInServiceReq ¶
type ListInServiceReq struct { ServicePath string `json:"-"` Active int `json:"active"` Page int `json:"page"` PageSize int `json:"pageSize"` }
ListInServiceReq ListInServiceReq
type ListInServiceResp ¶
type ListInServiceResp struct { Total int `json:"total"` Page int `json:"page"` List []*RawListNode `json:"list"` }
ListInServiceResp ListInServiceResp
type ListKMSCustomerKeyReq ¶
type ListKMSCustomerKeyReq struct { Page int `json:"page"` PageSize int `json:"limit"` Service string `json:"service"` Active int `json:"active"` Owner string `json:"-"` }
ListKMSCustomerKeyReq req
type ListKMSCustomerKeyResp ¶
type ListKMSCustomerKeyResp struct { Keys []*KMSCustomerKey `json:"keys"` Total int `json:"total"` }
ListKMSCustomerKeyResp resp
type ListNsByPrefixPathReq ¶
type ListNsByPrefixPathReq struct { NamespacePath string `json:"-"` Active int `json:"active"` Page int `json:"page"` PageSize int `json:"pageSize"` }
ListNsByPrefixPathReq ListNsByPrefixPathReq
type ListNsByPrefixPathResp ¶
type ListNsByPrefixPathResp struct { Total int `json:"total"` Page int `json:"page"` List []*APINamespace `json:"list"` }
ListNsByPrefixPathResp ListNsByPrefixPathResp
type ListNsReq ¶
type ListNsReq struct { NamespacePath string `json:"-"` Active int `json:"active"` Page int `json:"page"` PageSize int `json:"pageSize"` }
ListNsReq ListNsReq
type ListNsResp ¶
type ListNsResp struct { Total int `json:"total"` Page int `json:"page"` List []*NamespaceResp `json:"list"` }
ListNsResp ListNsResp
type ListPolyByPrefixPathReq ¶
type ListPolyByPrefixPathReq struct { NamespacePath string `json:"-"` Active int `json:"active"` Page int `json:"page"` PageSize int `json:"pageSize"` }
ListPolyByPrefixPathReq ListPolyByPrefixPathReq
type ListPolyByPrefixPathResp ¶
type ListPolyByPrefixPathResp struct { List []*PolyAPIFull `json:"list"` Total int64 `json:"total"` Page int `json:"page"` }
ListPolyByPrefixPathResp ListPolyByPrefixPathResp
type ListRawByPrefixPathReq ¶
type ListRawByPrefixPathReq = RawListReq
ListRawByPrefixPathReq ListRawByPrefixPathReq
type ListRawByPrefixPathResp ¶
type ListRawByPrefixPathResp struct { List []*RawAPIFull `json:"list"` Total int64 `json:"total"` Page int `json:"page"` }
ListRawByPrefixPathResp ListRawByPrefixPathResp
type ListRawPolyByPrefixPathReq ¶
type ListRawPolyByPrefixPathReq struct {
Path string `json:"-"`
}
ListRawPolyByPrefixPathReq ListRawPolyByPrefixPathReq
type ListRawPolyByPrefixPathResp ¶
type ListRawPolyByPrefixPathResp struct {
List []*RawPoly `json:"list"`
}
ListRawPolyByPrefixPathResp ListRawPolyByPrefixPathResp
type ListServiceByPrefixReq ¶
type ListServiceByPrefixReq struct { NamespacePath string `json:"-"` Page int `json:"page"` PageSize int `json:"pageSize"` }
ListServiceByPrefixReq ListServiceByPrefixReq
type ListServiceByPrefixResp ¶
type ListServiceByPrefixResp struct { Total int `json:"total"` Page int `json:"page"` List []*APIService `json:"list"` }
ListServiceByPrefixResp ListServiceByPrefixResp
type ListServiceReq ¶
type ListServiceReq struct { NamespacePath string `json:"-"` Page int `json:"page"` PageSize int `json:"pageSize"` }
ListServiceReq ListServiceReq
type ListServiceResp ¶
type ListServiceResp struct { Total int `json:"total"` Page int `json:"page"` List []*ServicesResp `json:"list"` }
ListServiceResp ListServiceResp
type NamespaceOper ¶
type NamespaceOper interface { Create(c context.Context, req *CreateNsReq) (*NamespaceResp, error) Check(c context.Context, namespace string, owner string, op Operation) (*NamespaceResp, error) List(c context.Context, req *ListNsReq) (*ListNsResp, error) InnerDelete(c context.Context, req *DeleteNsReq) (*DeleteNsResp, error) ValidWithSub(c context.Context, req *UpdateNsValidReq) (*UpdateNsValidResp, error) ListByPrefixPath(c context.Context, req *ListNsByPrefixPathReq) (*ListNsByPrefixPathResp, error) InnerImport(c context.Context, req *InnerImportNsReq) (*InnerImportNsResp, error) InnerDelByPrefixPath(ctx context.Context, req *InnerDelNsByPrefixPathReq) (*InnerDelNsByPrefixPathResp, error) Update(c context.Context, req *UpdateNsReq) (*UpdateNsResp, error) }
NamespaceOper NamespaceOper
func GetNamespaceOper ¶
func GetNamespaceOper() NamespaceOper
GetNamespaceOper get the instance of namespace oper
func SetNamespaceOper ¶
func SetNamespaceOper(f NamespaceOper) NamespaceOper
SetNamespaceOper set the instance of namespace oper
type NamespaceResp ¶
type NamespaceResp struct { ID string `json:"id"` Owner string `json:"owner"` OwnerName string `json:"ownerName"` Parent string `json:"parent"` Name string `json:"name"` SubCount uint `json:"subCount"` Title string `json:"title"` Desc string `json:"desc"` // Access uint Active uint `json:"active"` CreateAt int64 `json:"createAt"` UpdateAt int64 `json:"updateAt"` FullPath string `json:"-"` }
NamespaceResp NamespaceResp
type Operation ¶
type Operation uint
Operation is enum of operation, create/update/delete/query/request/polyapi/rawapi
const ( OpCreate Operation = iota + 1 OpUpdate OpEdit // edit arrange OpDelete OpQuery OpBuild OpAddRawAPI OpAddPolyAPI OpAddService OpAddSub OpRequest OpPublish )
operations
func (Operation) RequireScriptReady ¶
RequireScriptReady check if an operation need script ready
type PolyAPIFull ¶
type PolyAPIFull struct { ID string `gorm:"primarykey" json:"id"` // uuid Owner string `json:"owner"` // owner OwnerName string `json:"ownerName"` // owner name Namespace string `json:"namespace"` Name string `json:"name"` // name Title string `json:"title"` Desc string `json:"desc"` Access uint `json:"access"` Active uint `json:"active"` Method string `json:"method"` Arrange string `json:"arrange"` // arrange info Doc string `json:"doc"` Script string `json:"script"` Valid uint `json:"valid"` CreateAt int64 `json:"createAt"` // create time UpdateAt int64 `json:"updateAt"` // update time DeleteAt *int64 `json:"deleteAt"` // delete time BuildAt int64 `json:"buildAt"` // build time }
PolyAPIFull is the poly api db scheme
type PolyAPIOper ¶
type PolyAPIOper interface { List(c context.Context, req *PolyListReq) (*PolyListResp, error) InnerDelete(c context.Context, req *PolyDeleteReq) (*PolyDeleteResp, error) ValidInBatches(ctx context.Context, req *PolyValidInBatchesReq) (*PolyValidInBatchesResp, error) ValidByPrefixPath(ctx context.Context, req *PolyValidByPrefixPathReq) (*PolyValidByPrefixPathResp, error) ListByPrefixPath(ctx context.Context, req *ListPolyByPrefixPathReq) (*ListPolyByPrefixPathResp, error) InnerImport(ctx context.Context, req *InnerImportPolyReq) (*InnerImportPolyResp, error) InnerDelByPrefixPath(ctx context.Context, req *InnerDelPolyByPrefixPathReq) (*InnerDelPolyByPrefixPathResp, error) QuerySwagger(ctx context.Context, req *QueryPolySwaggerReq) (*QueryPolySwaggerResp, error) }
PolyAPIOper is the interface for poly api operator
func SetPolyOper ¶
func SetPolyOper(f PolyAPIOper) PolyAPIOper
SetPolyOper set the instance of poly oper
type PolyDeleteReq ¶
type PolyDeleteReq struct { NamespacePath string `json:"-" binding:"-"` // Names []string `json:"names"` Owner string `json:"-"` }
PolyDeleteReq PolyDeleteReq
type PolyListNode ¶
type PolyListNode struct { ID string `json:"id"` Owner string `json:"owner"` OwnerName string `json:"ownerName"` FullPath string `json:"fullPath"` Method string `json:"method"` Name string `json:"name"` Title string `json:"title"` Desc string `json:"desc"` Active uint `json:"active"` Valid uint `json:"valid"` CreateAt int64 `json:"createAt"` UpdateAt int64 `json:"updateAt"` AccessPath string `json:"accessPath"` }
PolyListNode node
type PolyListReq ¶
type PolyListReq struct { NamespacePath string `json:"-"` Active int `json:"active"` Page int `json:"page"` PageSize int `json:"pageSize"` }
PolyListReq polyListReq
type PolyListResp ¶
type PolyListResp struct { Total int `json:"total"` Page int `json:"page"` List []*PolyListNode `json:"list"` }
PolyListResp PolyListResp
type PolyValidByPrefixPathReq ¶
PolyValidByPrefixPathReq PolyValidByPrefixPathReq
type PolyValidByPrefixPathResp ¶
type PolyValidByPrefixPathResp struct { }
PolyValidByPrefixPathResp PolyValidByPrefixPathResp
type PolyValidInBatchesReq ¶
PolyValidInBatchesReq PolyValidInBatchesReq
type PolyValidInBatchesResp ¶
type PolyValidInBatchesResp struct{}
PolyValidInBatchesResp PolyValidInBatchesResp
type QueryByPolyAPIReq ¶
type QueryByPolyAPIReq struct {
PolyAPI string `json:"polyAPI"`
}
QueryByPolyAPIReq QueryByPolyAPIReq
type QueryByPolyAPIResp ¶
type QueryByPolyAPIResp = QueryRawPolyResp
QueryByPolyAPIResp QueryByPolyAPIResp
type QueryByRawAPIReq ¶
type QueryByRawAPIReq struct {
RawAPI []string `json:"rawAPI"`
}
QueryByRawAPIReq QueryByRawAPIReq
type QueryByRawAPIResp ¶
type QueryByRawAPIResp = QueryRawPolyResp
QueryByRawAPIResp QueryByRawAPIResp
type QueryKMSCustomerKeyResp ¶
type QueryKMSCustomerKeyResp struct { ID string `json:"id"` Owner string `json:"owner"` OwnerName string `json:"ownerName"` Name string `json:"name"` Title string `json:"title"` Description string `json:"description"` Service string `json:"service"` Host string `json:"host"` AuthType string `json:"authType"` AuthContent string `json:"authContent"` KeyID string `json:"keyID"` KeyContent string `json:"keyContent"` Active int `json:"active"` CreateAt int64 `json:"createAt"` UpdateAt int64 `json:"updateAt"` }
QueryKMSCustomerKeyResp resp
type QueryPolySwaggerReq ¶
type QueryPolySwaggerReq struct {
APIPath []string `json:"-"`
}
QueryPolySwaggerReq QueryPolySwaggerReq
type QueryPolySwaggerResp ¶
type QueryPolySwaggerResp struct {
Swagger []byte `json:"swagger"`
}
QueryPolySwaggerResp QueryPolySwaggerResp
type QueryRawAPIInBatchesReq ¶
type QueryRawAPIInBatchesReq struct {
APIPathList []string
}
QueryRawAPIInBatchesReq QueryRawAPIInBatchesReq
type QueryRawAPIInBatchesResp ¶
type QueryRawAPIInBatchesResp struct {
List []*RawListNode `json:"list"`
}
QueryRawAPIInBatchesResp QueryRawAPIInBatchesResp
type QueryRawAPIReq ¶
type QueryRawAPIReq struct {
APIPath string `json:"-"`
}
QueryRawAPIReq QueryRawAPIReq
type QueryRawAPIResp ¶
type QueryRawAPIResp struct { Content *RawAPIContent `json:"-"` ID string `json:"id"` URL string `json:"url"` Method string `json:"method"` Owner string `json:"owner"` OwnerName string `json:"ownerName"` Namespace string `json:"namespace"` Name string `json:"name"` Title string `json:"title"` Desc string `json:"desc"` Active uint `json:"active"` Valid uint `json:"valid"` Service string `json:"service"` Schema string `json:"schema"` Host string `json:"host"` AuthType string `json:"authType"` UpdateAt int64 `json:"updateAt"` }
QueryRawAPIResp QueryRawAPIResp
type QueryRawPolyResp ¶
type QueryRawPolyResp struct { Total int64 `json:"total"` List []*RawPolyResp `json:"list"` }
QueryRawPolyResp QueryRawPolyResp
type QueryRawSwaggerReq ¶
type QueryRawSwaggerReq struct {
APIPath []string `json:"-"`
}
QueryRawSwaggerReq QueryRawSwaggerReq
type QueryRawSwaggerResp ¶
type QueryRawSwaggerResp struct {
Swagger []byte `json:"swagger"`
}
QueryRawSwaggerResp QueryRawSwaggerResp
type RawAPIContent ¶
type RawAPIContent struct { ID string `json:"x-id"` Action string `json:"x-action"` // action, extended Consts expr.SwagConstValueSet `json:"x-consts"` // predefined values, extended Input expr.InputNodeDetail `json:"x-input"` Output expr.OutputNodeDetail `json:"x-output"` BasePath string `json:"basePath"` Path string `json:"path"` Method string `json:"method"` EncodingIn string `json:"encoding-in"` EncodingOut string `json:"encoding-out"` Summary string `json:"summary"` Desc string `json:"desc"` }
RawAPIContent is the content field detail
func (*RawAPIContent) GetAction ¶
func (c *RawAPIContent) GetAction() *expr.SwagConstValue
GetAction return the action predef value
type RawAPIFull ¶
type RawAPIFull struct { ID string Owner string OwnerName string Namespace string Service string Name string Title string Desc string Path string URL string Action string // action Method string // method GET|POST|... Version string Access uint Active uint Valid uint Schema string Host string AuthType string CreateAt int64 // create time UpdateAt int64 // update time DeleteAt *int64 // delete time Doc *APIDoc Content *RawAPIContent }
RawAPIFull is the raw api db scheme
type RawAPIOper ¶
type RawAPIOper interface { Query(c context.Context, req *QueryRawAPIReq) (*QueryRawAPIResp, error) QueryInBatches(c context.Context, req *QueryRawAPIInBatchesReq) (*QueryRawAPIInBatchesResp, error) List(c context.Context, req *RawListReq) (*RawListResp, error) ListInService(c context.Context, req *ListInServiceReq) (*ListInServiceResp, error) InnerUpdateRawInBatch(ctx context.Context, req *InnerUpdateRawInBatchReq) (*InnerUpdateRawInBatchResp, error) InnerDel(c context.Context, req *DelReq) (*DelResp, error) ValidInBatches(ctx context.Context, req *RawValidInBatchesReq) (*RawValidInBatchesResp, error) ValidByPrefixPath(ctx context.Context, req *RawValidByPrefixPathReq) (*RawValidByPrefixPathResp, error) ListByPrefixPath(ctx context.Context, req *ListRawByPrefixPathReq) (*ListRawByPrefixPathResp, error) InnerImport(ctx context.Context, req *InnerImportRawReq) (*InnerImportRawResp, error) InnerDelByPrefixPath(ctx context.Context, req *InnerDelRawByPrefixPathReq) (*InnerDelRawByPrefixPathResp, error) QuerySwagger(ctx context.Context, req *QueryRawSwaggerReq) (*QueryRawSwaggerResp, error) QueryDoc(c context.Context, req *apiprovider.QueryDocReq) (*apiprovider.QueryDocResp, error) }
RawAPIOper is the interface for query raw api
func SetRawAPIOper ¶
func SetRawAPIOper(f RawAPIOper) RawAPIOper
SetRawAPIOper set the instance of RawAPIOper
type RawListNode ¶
type RawListNode struct { ID string `json:"id"` Owner string `json:"owner"` OwnerName string `json:"ownerName"` Name string `json:"name"` Title string `json:"title"` Desc string `json:"desc"` FullPath string `json:"fullPath"` URL string `json:"url"` Version string `json:"version"` Method string `json:"method"` Action string `json:"action"` Active uint `json:"active"` Valid uint `json:"valid"` CreateAt int64 `json:"createAt"` UpdateAt int64 `json:"updateAt"` URI string `json:"uri"` AccessPath string `json:"accessPath"` }
RawListNode RawListNode
type RawListReq ¶
type RawListReq struct { NamespacePath string `uri:"namespacePath"` Active int `json:"active"` Page int `json:"page"` PageSize int `json:"pageSize"` }
RawListReq RawListReq
type RawListResp ¶
type RawListResp struct { Total int `json:"total"` Page int `json:"page"` List []*RawListNode `json:"list"` }
RawListResp RawListResp
type RawPoly ¶
type RawPoly struct { ID string `json:"id"` RawAPI string `gorm:"column:raw_api" json:"rawAPI"` PolyAPI string `gorm:"column:poly_api" json:"polyAPI"` }
RawPoly the relationship between raw api and poly api
type RawPolyOper ¶
type RawPolyOper interface { CreateInBatches(ctx context.Context, req *CreateRawPolyReq) (*CreateRawPolyResp, error) DeleteByRawAPI(ctx context.Context, req *DeleteByRawAPIReq) (*DeleteByRawAPIResp, error) DeleteByPolyAPI(ctx context.Context, req *DeleteByPolyAPIReq) (*DeleteByPolyAPIResp, error) DeleteByPolyAPIInBatches(ctx context.Context, req *DeleteByPolyAPIInBatchesReq) (*DeleteByPolyAPIInBatchesResp, error) QueryByRawAPI(ctx context.Context, req *QueryByRawAPIReq) (*QueryByRawAPIResp, error) QueryByPolyAPI(ctx context.Context, req *QueryByPolyAPIReq) (*QueryByPolyAPIResp, error) UpdateRawPoly(ctx context.Context, req *UpdateRawPolyReq) (*UpdateRawPolyResp, error) ListByPrefixPath(ctx context.Context, req *ListRawPolyByPrefixPathReq) (*ListRawPolyByPrefixPathResp, error) InnerImport(ctx context.Context, req *InnerImportRawPolyReq) (*InnerImportRawPolyResp, error) InnerDelByPrefixPath(ctx context.Context, req *InnerDelRawPolyByPrefixPathReq) (*InnerDelRawPolyByPrefixPathResp, error) }
RawPolyOper is the interface of rawPoly adaptor
func GetRawPolyOper ¶
func GetRawPolyOper() RawPolyOper
GetRawPolyOper get the instance of RawPolyOper
func SetRawPolyOper ¶
func SetRawPolyOper(f RawPolyOper) RawPolyOper
SetRawPolyOper set the instance of RawPolyOper
type RawPolyResp ¶
type RawPolyResp struct { ID string `json:"id"` RawAPI string `json:"rawAPI"` PolyAPI string `json:"polyAPI"` }
RawPolyResp RawPolyResp
type RawValidByPrefixPathReq ¶
RawValidByPrefixPathReq RawValidByPrefixPathReq
type RawValidByPrefixPathResp ¶
type RawValidByPrefixPathResp struct { }
RawValidByPrefixPathResp RawValidByPrefixPathResp
type RawValidInBatchesReq ¶
RawValidInBatchesReq RawValidInBatchesReq
type RawValidInBatchesResp ¶
type RawValidInBatchesResp struct{}
RawValidInBatchesResp RawValidInBatchesResp
type Schema ¶
type Schema struct { Input json.RawMessage `json:"input"` Output json.RawMessage `json:"output"` }
Schema json schema
type ServiceOper ¶
type ServiceOper interface { Check(c context.Context, service string, owner string, op Operation) (*ServicesResp, error) List(c context.Context, req *ListServiceReq) (*ListServiceResp, error) Delete(c context.Context, req *DeleteServiceReq) (*DeleteServiceResp, error) Query(c context.Context, service string) (*ServicesResp, error) InnerDelete(c context.Context, req *InnerDeleteServiceReq) (*InnerDeleteServiceResp, error) ListByPrefixPath(c context.Context, req *ListServiceByPrefixReq) (*ListServiceByPrefixResp, error) InnerImport(c context.Context, req *InnerImportServiceReq) (*InnerImportServiceResp, error) InnerDelByPrefixPath(ctx context.Context, req *InnerDelServiceByPrefixPathReq) (*InnerDelServiceByPrefixPathResp, error) }
ServiceOper ServiceOper
func GetServiceOper ¶
func GetServiceOper() ServiceOper
GetServiceOper get the instance of service oper
func SetServiceOper ¶
func SetServiceOper(f ServiceOper) ServiceOper
SetServiceOper set the instance of service oper
type ServicesResp ¶
type ServicesResp struct { ID string `json:"id"` Owner string `json:"owner"` OwnerName string `json:"owenrName"` FullPath string `json:"fullPath"` Title string `json:"title"` Desc string `json:"desc"` Active uint `json:"active"` Schema string `json:"schema"` Host string `json:"host"` AuthType string `json:"authType"` AuthContent string `json:"authContent"` CreateAt int64 `json:"createAt"` UpdateAt int64 `json:"updateAt"` }
ServicesResp ServicesResp
type UpdateCustomerKeyInBatchReq ¶
type UpdateCustomerKeyInBatchReq struct { Host string `json:"host"` Service string `json:"service"` AuthType string `json:"authType"` AuthContent string `json:"authContent"` }
UpdateCustomerKeyInBatchReq UpdateCustomerKeyInBatchReq
type UpdateCustomerKeyInBatchResp ¶
type UpdateCustomerKeyInBatchResp struct { }
UpdateCustomerKeyInBatchResp UpdateCustomerKeyInBatchResp
type UpdateNsReq ¶
type UpdateNsReq struct { NamespacePath string `json:"-"` Title string `json:"title"` Desc string `json:"desc"` }
UpdateNsReq UpdateNsReq
type UpdateNsResp ¶
type UpdateNsResp struct {
FullPath string `json:"fullPath"`
}
UpdateNsResp UpdateNsResp
type UpdateNsValidReq ¶
UpdateNsValidReq UpdateNsValidReq
type UpdateRawPolyReq ¶
type UpdateRawPolyReq struct { PolyAPI string `json:"polyAPI"` RawAPIList []string `json:"rawAPIList"` }
UpdateRawPolyReq UpdateRawPolyReq