adaptor

package
v0.0.0-...-55524bd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

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

func (*APIDoc) Scan

func (c *APIDoc) Scan(data interface{}) error

Scan unmarshal

func (APIDoc) Value

func (c APIDoc) Value() (driver.Value, error)

Value marshal

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 CheckAuthResp

type CheckAuthResp struct {
}

CheckAuthResp CheckAuthResp

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 CreateRawPolyResp

type CreateRawPolyResp struct{}

CreateRawPolyResp CreateRawPolyResp

type DelReq

type DelReq struct {
	NamespacePath string   `json:"-" binding:"-"` //
	Names         []string `json:"names"`
	Owner         string   `json:"-"`
}

DelReq DelReq

type DelResp

type DelResp struct {
}

DelResp DelResp

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 DeleteByRawAPIResp

type DeleteByRawAPIResp struct{}

DeleteByRawAPIResp DeleteByRawAPIResp

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

type DeleteServiceReq struct {
	ServicePath string `json:"-"`
	Owner       string `json:"-"`
}

DeleteServiceReq DeleteServiceReq

type DeleteServiceResp

type DeleteServiceResp struct {
	FullPath string `json:"fullPath"`
}

DeleteServiceResp DelteServiceResp

type EvalerOper

type EvalerOper interface {
	CreateEvaler() protocol.Evaler
}

EvalerOper if Evaler creater

func GetEvalerOper

func GetEvalerOper() EvalerOper

GetEvalerOper get the instance of Evaler oper

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

type InnerDeleteServiceReq struct {
	NamespacePath string   `json:"-"`
	Names         []string `json:"names"`
}

InnerDeleteServiceReq InnerDeleteServiceReq

type InnerDeleteServiceResp

type InnerDeleteServiceResp struct {
}

InnerDeleteServiceResp InnerDeleteServiceResp

type InnerImportNsReq

type InnerImportNsReq struct {
	List []*APINamespace `json:"list"`
}

InnerImportNsReq InnerImportNsReq

type InnerImportNsResp

type InnerImportNsResp struct {
}

InnerImportNsResp InnerImportNsResp

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 InnerImportRawResp

type InnerImportRawResp struct {
}

InnerImportRawResp InnerImportRawResp

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

func GetKMSOper

func GetKMSOper() KMSOper

GetKMSOper get the instance of kms oper

func SetKMSOper

func SetKMSOper(f KMSOper) KMSOper

SetKMSOper set the instance of kms oper

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

func (op Operation) RequireScriptReady() bool

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

PolyAPIOper is the interface for poly api operator

func GetPolyOper

func GetPolyOper() PolyAPIOper

GetPolyOper get the instance of poly oper

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 PolyDeleteResp

type PolyDeleteResp struct{}

PolyDeleteResp PolyDeleteResp

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

type PolyValidByPrefixPathReq struct {
	NamespacePath string `json:"-"`
	Valid         uint   `json:"valid"`
}

PolyValidByPrefixPathReq PolyValidByPrefixPathReq

type PolyValidByPrefixPathResp

type PolyValidByPrefixPathResp struct {
}

PolyValidByPrefixPathResp PolyValidByPrefixPathResp

type PolyValidInBatchesReq

type PolyValidInBatchesReq struct {
	APIPath []string `json:"-"`
	Valid   uint     `json:"valid"`
}

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) Check

func (c *RawAPIContent) Check() error

Check verify the inputs

func (*RawAPIContent) GetAction

func (c *RawAPIContent) GetAction() *expr.SwagConstValue

GetAction return the action predef value

func (*RawAPIContent) Scan

func (c *RawAPIContent) Scan(data interface{}) error

Scan unmarshal

func (RawAPIContent) Value

func (c RawAPIContent) Value() (driver.Value, error)

Value marshal

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

RawAPIOper is the interface for query raw api

func GetRawAPIOper

func GetRawAPIOper() RawAPIOper

GetRawAPIOper get the instance of RawAPIOper

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

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

type RawValidByPrefixPathReq struct {
	NamespacePath string `json:"-"`
	Valid         uint   `json:"valid"`
}

RawValidByPrefixPathReq RawValidByPrefixPathReq

type RawValidByPrefixPathResp

type RawValidByPrefixPathResp struct {
}

RawValidByPrefixPathResp RawValidByPrefixPathResp

type RawValidInBatchesReq

type RawValidInBatchesReq struct {
	APIPath []string
	Valid   uint `json:"valid"`
}

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

func (*Schema) Scan

func (c *Schema) Scan(data interface{}) error

Scan unmarshal

func (Schema) Value

func (c Schema) Value() (driver.Value, error)

Value marshal

type ServiceOper

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

type UpdateNsValidReq struct {
	NamespacePath string `json:"-"`
	Valid         uint   `json:"valid"`
}

UpdateNsValidReq UpdateNsValidReq

type UpdateNsValidResp

type UpdateNsValidResp struct {
}

UpdateNsValidResp UpdateNsValidResp

type UpdateRawPolyReq

type UpdateRawPolyReq struct {
	PolyAPI    string   `json:"polyAPI"`
	RawAPIList []string `json:"rawAPIList"`
}

UpdateRawPolyReq UpdateRawPolyReq

type UpdateRawPolyResp

type UpdateRawPolyResp struct{}

UpdateRawPolyResp UpdateRawPolyResp

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL