Documentation ¶
Overview ¶
Package asset API 资产
Index ¶
- Constants
- func Json2Yaml(data []byte) []byte
- func Oas2Json(data []byte) []byte
- func Oas2Yaml(data []byte) []byte
- func Oas3Json(data []byte) []byte
- func Oas3Yaml(data []byte) []byte
- func OnceADayLimitType() []apistructs.LimitType
- func V3ToCsv(v3 *openapi3.Swagger, assetID, assetName, versionName string, ...) ([]byte, *errorresp.APIError)
- func Yaml2Json(data []byte) []byte
- type Action
- type ApprovalResult
- type Option
- type RequestItem
- type Service
- func (svc *Service) ApprovalResultFromStatus(ctx context.Context, status apistructs.ContractStatus, locale string) ApprovalResult
- func (svc *Service) ApprovalResultSLAUpdated(ctx context.Context, name, locale string) ApprovalResult
- func (svc *Service) ApprovalResultWhileDelete(ctx context.Context, status apistructs.ContractStatus, locale string) ApprovalResult
- func (svc *Service) CheckClientIDSecret(orgID, userID, clientID, clientSecret string) error
- func (svc *Service) CreateAPIAsset(ctx context.Context, req apistructs.APIAssetCreateRequest) (apiAssetID string, err error)
- func (svc *Service) CreateAPIAssetVersion(ctx context.Context, req apistructs.APIAssetVersionCreateRequest) (apiAsset *dbclient.APIAssetsModel, version *apistructs.APIAssetVersionsModel, ...)
- func (svc *Service) CreateAccess(ctx context.Context, req *apistructs.CreateAccessReq) (map[string]interface{}, *errorresp.APIError)
- func (svc *Service) CreateClient(ctx context.Context, req *apistructs.CreateClientReq) (*apistructs.ClientModel, *errorresp.APIError)
- func (svc *Service) CreateContract(ctx context.Context, req *apistructs.CreateContractReq) (*apistructs.ClientModel, *apistructs.SK, *apistructs.ContractModel, ...)
- func (svc *Service) CreateInstantiation(ctx context.Context, req *apistructs.CreateInstantiationReq) (*apistructs.InstantiationModel, *errorresp.APIError)
- func (svc *Service) CreateSLA(ctx context.Context, req *apistructs.CreateSLAReq) *errorresp.APIError
- func (svc *Service) DeleteAccess(ctx context.Context, req *apistructs.GetAccessReq) *errorresp.APIError
- func (svc *Service) DeleteAssetByAssetID(ctx context.Context, req apistructs.APIAssetDeleteRequest) error
- func (svc *Service) DeleteAssetVersionByID(ctx context.Context, orgID uint64, assetID string, versionID uint64, ...) error
- func (svc *Service) DeleteClient(req *apistructs.DeleteClientReq) *errorresp.APIError
- func (svc *Service) DeleteContract(ctx context.Context, req *apistructs.GetContractReq) *errorresp.APIError
- func (svc *Service) DeleteSLA(ctx context.Context, req *apistructs.DeleteSLAReq) *errorresp.APIError
- func (svc *Service) DownloadSpecText(req *apistructs.DownloadSpecTextReq) ([]byte, *errorresp.APIError)
- func (svc *Service) EmailNotify(title, templateName string, params map[string]string, locale string, ...) error
- func (svc *Service) FirstRecord(model interface{}, where map[string]interface{}) error
- func (svc *Service) GetAccess(req *apistructs.GetAccessReq) (map[string]interface{}, *errorresp.APIError)
- func (svc *Service) GetApp(appID uint64) (*apistructs.ApplicationDTO, error)
- func (svc *Service) GetApplicationServices(applicationID uint64, orgID uint64, userID string) ([]*apistructs.ListRuntimeServicesResp, *errorresp.APIError)
- func (svc *Service) GetAsset(req *apistructs.GetAPIAssetReq) (*apistructs.GetAPIAssetResponse, error)
- func (svc *Service) GetAssetVersion(req *apistructs.GetAPIAssetVersionReq) (*apistructs.GetAssetVersionRsp, error)
- func (svc *Service) GetContract(req *apistructs.GetContractReq) (*apistructs.ClientModel, *apistructs.SK, *apistructs.ContractModel, ...)
- func (svc *Service) GetEndpointDomains(orgID, userID, endpointID string) []string
- func (svc *Service) GetInstantiation(req *apistructs.GetInstantiationsReq) (*apistructs.InstantiationModel, bool, *errorresp.APIError)
- func (svc *Service) GetMyClient(req *apistructs.GetClientReq) (*apistructs.ClientObj, *errorresp.APIError)
- func (svc *Service) GetOperation(req *apistructs.GetOperationReq) (data *apistructs.GetOperationResp, apiError *errorresp.APIError)
- func (svc *Service) GetProject(projectID uint64) (*apistructs.ProjectDTO, error)
- func (svc *Service) GetRuntimeServices(runtimeID uint64, orgID uint64, userID string) (*bundle.GetRuntimeServicesResponseData, error)
- func (svc *Service) GetSLA(ctx context.Context, req *apistructs.GetSLAReq) (*apistructs.GetSLARsp, *errorresp.APIError)
- func (svc *Service) ListAPIGateways(req *apistructs.ListAPIGatewaysReq) ([]map[string]string, *errorresp.APIError)
- func (svc *Service) ListAccess(req *apistructs.ListAccessReq) (*apistructs.ListAccessRsp, *errorresp.APIError)
- func (svc *Service) ListContractRecords(req *apistructs.ListContractRecordsReq) (*apistructs.ListContractRecordsRsp, *errorresp.APIError)
- func (svc *Service) ListContracts(ctx context.Context, req *apistructs.ListContractsReq) (*apistructs.ListContractsRsp, *errorresp.APIError)
- func (svc *Service) ListMyClients(req *apistructs.ListMyClientsReq) (*apistructs.ListMyClientsRsp, *errorresp.APIError)
- func (svc *Service) ListProjectAPIGateways(req *apistructs.ListProjectAPIGatewaysReq) ([]map[string]string, *errorresp.APIError)
- func (svc *Service) ListRecords(models interface{}, where map[string]interface{}) error
- func (svc *Service) ListSLAs(ctx context.Context, req *apistructs.ListSLAsReq) (*apistructs.ListSLAsRsp, *errorresp.APIError)
- func (svc *Service) ListSwaggerVersionClients(ctx context.Context, req *apistructs.ListSwaggerVersionClientsReq) (*apistructs.ListSwaggerVersionClientRsp, *errorresp.APIError)
- func (svc *Service) ListSwaggerVersions(req *apistructs.ListSwaggerVersionsReq) (*apistructs.ListSwaggerVersionRsp, error)
- func (svc *Service) ManagerProvedContract(ctx context.Context, locale string) ApprovalResult
- func (svc *Service) ManagerRewriteSLA(ctx context.Context, name, locale string) ApprovalResult
- func (svc *Service) MboxNotify(title, templateName string, params map[string]string, locale string, ...) error
- func (svc *Service) PagingAPIAssetVersions(ctx context.Context, req *apistructs.PagingAPIAssetVersionsReq) (responseData *apistructs.PagingAPIAssetVersionResponse, userIDs []string, ...)
- func (svc *Service) PagingAsset(req apistructs.PagingAPIAssetsReq) (*apistructs.APIAssetPagingResponse, error)
- func (svc *Service) RequestItemAPI(ctx context.Context, name, swaggerVersion, locale string) RequestItem
- func (svc *Service) RequestItemSLA(ctx context.Context, name, locale string) RequestItem
- func (svc *Service) SearchOperations(req *apistructs.SearchOperationsReq) (results []*apistructs.APIOAS3IndexModel, apiError *errorresp.APIError)
- func (svc *Service) UpdateAPIAsset(req *apistructs.UpdateAPIAssetReq) *errorresp.APIError
- func (svc *Service) UpdateAccess(ctx context.Context, req *apistructs.UpdateAccessReq) (*apistructs.APIAccessesModel, *errorresp.APIError)
- func (svc *Service) UpdateAssetVersion(ctx context.Context, req *apistructs.UpdateAssetVersionReq) (*apistructs.APIAssetVersionsModel, *errorresp.APIError)
- func (svc *Service) UpdateClient(req *apistructs.UpdateClientReq) (*apistructs.ClientModel, *apistructs.SK, *errorresp.APIError)
- func (svc *Service) UpdateContract(ctx context.Context, req *apistructs.UpdateContractReq) (*apistructs.ClientModel, *apistructs.ContractModel, *errorresp.APIError)
- func (svc *Service) UpdateInstantiation(ctx context.Context, req *apistructs.UpdateInstantiationReq) (*apistructs.InstantiationModel, *errorresp.APIError)
- func (svc *Service) UpdateSLA(ctx context.Context, req *apistructs.UpdateSLAReq) *errorresp.APIError
Constants ¶
View Source
const ( InsTypeDice = "dice" InsTypeExternal = "external" )
View Source
const ( WorkspaceDev = "DEV" WorkspaceTest = "TEST" WorkspaceStaging = "STAGING" WorkspaceProd = "PROD" )
View Source
const (
AddonNameAPIGateway = "api-gateway"
)
Variables ¶
This section is empty.
Functions ¶
func OnceADayLimitType ¶
func OnceADayLimitType() []apistructs.LimitType
Types ¶
type ApprovalResult ¶
type ApprovalResult string
type Option ¶
type Option func(*Service)
func WithBranchRuleSvc ¶
func WithBranchRuleSvc(branchRule *branchrule.BranchRule) Option
WithBranchRuleSvc sets the branch rule client
func WithBundle ¶
type RequestItem ¶
type RequestItem string
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) ApprovalResultFromStatus ¶
func (svc *Service) ApprovalResultFromStatus(ctx context.Context, status apistructs.ContractStatus, locale string) ApprovalResult
func (*Service) ApprovalResultSLAUpdated ¶
func (svc *Service) ApprovalResultSLAUpdated(ctx context.Context, name, locale string) ApprovalResult
approval results
func (*Service) ApprovalResultWhileDelete ¶
func (svc *Service) ApprovalResultWhileDelete(ctx context.Context, status apistructs.ContractStatus, locale string) ApprovalResult
func (*Service) CheckClientIDSecret ¶
func (*Service) CreateAPIAsset ¶
func (svc *Service) CreateAPIAsset(ctx context.Context, req apistructs.APIAssetCreateRequest) (apiAssetID string, err error)
CreateAPIAsset 创建 API 资料
func (*Service) CreateAPIAssetVersion ¶
func (svc *Service) CreateAPIAssetVersion(ctx context.Context, req apistructs.APIAssetVersionCreateRequest) (apiAsset *dbclient.APIAssetsModel, version *apistructs.APIAssetVersionsModel, spec *dbclient.APIAssetVersionSpecsModel, err error)
CreateAPIAssetVersion 创建 API 资料版本
func (*Service) CreateAccess ¶
func (svc *Service) CreateAccess(ctx context.Context, req *apistructs.CreateAccessReq) (map[string]interface{}, *errorresp.APIError)
func (*Service) CreateClient ¶
func (svc *Service) CreateClient(ctx context.Context, req *apistructs.CreateClientReq) (*apistructs.ClientModel, *errorresp.APIError)
func (*Service) CreateContract ¶
func (svc *Service) CreateContract(ctx context.Context, req *apistructs.CreateContractReq) (*apistructs.ClientModel, *apistructs.SK, *apistructs.ContractModel, *errorresp.APIError)
CreateContract 创建一个合约. 注意创建合约时, 需要查询客户端详情, 查询客户端详情时传入的 ClientID 是 dice_api_clients 的主键
func (*Service) CreateInstantiation ¶
func (svc *Service) CreateInstantiation(ctx context.Context, req *apistructs.CreateInstantiationReq) (*apistructs.InstantiationModel, *errorresp.APIError)
func (*Service) CreateSLA ¶
func (svc *Service) CreateSLA(ctx context.Context, req *apistructs.CreateSLAReq) *errorresp.APIError
func (*Service) DeleteAccess ¶
func (svc *Service) DeleteAccess(ctx context.Context, req *apistructs.GetAccessReq) *errorresp.APIError
func (*Service) DeleteAssetByAssetID ¶
func (svc *Service) DeleteAssetByAssetID(ctx context.Context, req apistructs.APIAssetDeleteRequest) error
DeleteAssetByAssetID 根据给定的 orgID 和 assetID 删除 APIAsset 表和 APIAssetVersionDetail 表的记录
func (*Service) DeleteAssetVersionByID ¶
func (svc *Service) DeleteAssetVersionByID(ctx context.Context, orgID uint64, assetID string, versionID uint64, userID string) error
根据给定的主键(id)删除 APIAssetVersion 表的记录
func (*Service) DeleteClient ¶
func (svc *Service) DeleteClient(req *apistructs.DeleteClientReq) *errorresp.APIError
func (*Service) DeleteContract ¶
func (svc *Service) DeleteContract(ctx context.Context, req *apistructs.GetContractReq) *errorresp.APIError
DeleteContract deletes contract
func (*Service) DeleteSLA ¶
func (svc *Service) DeleteSLA(ctx context.Context, req *apistructs.DeleteSLAReq) *errorresp.APIError
func (*Service) DownloadSpecText ¶
func (svc *Service) DownloadSpecText(req *apistructs.DownloadSpecTextReq) ([]byte, *errorresp.APIError)
func (*Service) EmailNotify ¶
func (*Service) FirstRecord ¶
func (*Service) GetAccess ¶
func (svc *Service) GetAccess(req *apistructs.GetAccessReq) (map[string]interface{}, *errorresp.APIError)
func (*Service) GetApp ¶
func (svc *Service) GetApp(appID uint64) (*apistructs.ApplicationDTO, error)
func (*Service) GetApplicationServices ¶
func (svc *Service) GetApplicationServices(applicationID uint64, orgID uint64, userID string) ([]*apistructs.ListRuntimeServicesResp, *errorresp.APIError)
func (*Service) GetAsset ¶
func (svc *Service) GetAsset(req *apistructs.GetAPIAssetReq) (*apistructs.GetAPIAssetResponse, error)
GetAsset 查询 API 资料
func (*Service) GetAssetVersion ¶
func (svc *Service) GetAssetVersion(req *apistructs.GetAPIAssetVersionReq) (*apistructs.GetAssetVersionRsp, error)
GetAssetVersion 查询 API 资料版本
func (*Service) GetContract ¶
func (svc *Service) GetContract(req *apistructs.GetContractReq) (*apistructs.ClientModel, *apistructs.SK, *apistructs.ContractModel, *errorresp.APIError)
func (*Service) GetEndpointDomains ¶
func (*Service) GetInstantiation ¶
func (svc *Service) GetInstantiation(req *apistructs.GetInstantiationsReq) (*apistructs.InstantiationModel, bool, *errorresp.APIError)
GetInstantiation 查询 minor 下的 instantiation ok: 是否存在这样的实例化记录, true: 存在
func (*Service) GetMyClient ¶
func (svc *Service) GetMyClient(req *apistructs.GetClientReq) (*apistructs.ClientObj, *errorresp.APIError)
func (*Service) GetOperation ¶
func (svc *Service) GetOperation(req *apistructs.GetOperationReq) (data *apistructs.GetOperationResp, apiError *errorresp.APIError)
node 包含 assert_id, info_version, path, method 四个字段的信息
func (*Service) GetProject ¶
func (svc *Service) GetProject(projectID uint64) (*apistructs.ProjectDTO, error)
func (*Service) GetRuntimeServices ¶
func (*Service) GetSLA ¶
func (svc *Service) GetSLA(ctx context.Context, req *apistructs.GetSLAReq) (*apistructs.GetSLARsp, *errorresp.APIError)
func (*Service) ListAPIGateways ¶
func (svc *Service) ListAPIGateways(req *apistructs.ListAPIGatewaysReq) ([]map[string]string, *errorresp.APIError)
func (*Service) ListAccess ¶
func (svc *Service) ListAccess(req *apistructs.ListAccessReq) (*apistructs.ListAccessRsp, *errorresp.APIError)
func (*Service) ListContractRecords ¶
func (svc *Service) ListContractRecords(req *apistructs.ListContractRecordsReq) (*apistructs.ListContractRecordsRsp, *errorresp.APIError)
func (*Service) ListContracts ¶
func (svc *Service) ListContracts(ctx context.Context, req *apistructs.ListContractsReq) (*apistructs.ListContractsRsp, *errorresp.APIError)
func (*Service) ListMyClients ¶
func (svc *Service) ListMyClients(req *apistructs.ListMyClientsReq) (*apistructs.ListMyClientsRsp, *errorresp.APIError)
func (*Service) ListProjectAPIGateways ¶
func (svc *Service) ListProjectAPIGateways(req *apistructs.ListProjectAPIGatewaysReq) ([]map[string]string, *errorresp.APIError)
func (*Service) ListRecords ¶
func (*Service) ListSLAs ¶
func (svc *Service) ListSLAs(ctx context.Context, req *apistructs.ListSLAsReq) (*apistructs.ListSLAsRsp, *errorresp.APIError)
查询 SLA 列表
func (*Service) ListSwaggerVersionClients ¶
func (svc *Service) ListSwaggerVersionClients(ctx context.Context, req *apistructs.ListSwaggerVersionClientsReq) (*apistructs.ListSwaggerVersionClientRsp, *errorresp.APIError)
func (*Service) ListSwaggerVersions ¶
func (svc *Service) ListSwaggerVersions(req *apistructs.ListSwaggerVersionsReq) (*apistructs.ListSwaggerVersionRsp, error)
func (*Service) ManagerProvedContract ¶
func (svc *Service) ManagerProvedContract(ctx context.Context, locale string) ApprovalResult
func (*Service) ManagerRewriteSLA ¶
func (svc *Service) ManagerRewriteSLA(ctx context.Context, name, locale string) ApprovalResult
func (*Service) MboxNotify ¶
func (*Service) PagingAPIAssetVersions ¶
func (svc *Service) PagingAPIAssetVersions(ctx context.Context, req *apistructs.PagingAPIAssetVersionsReq) (responseData *apistructs.PagingAPIAssetVersionResponse, userIDs []string, err error)
PagingAPIAssetVersions 获取 API 资料版本列表
func (*Service) PagingAsset ¶
func (svc *Service) PagingAsset(req apistructs.PagingAPIAssetsReq) (*apistructs.APIAssetPagingResponse, error)
PagingAsset 分页查询 API 资料
func (*Service) RequestItemAPI ¶
func (svc *Service) RequestItemAPI(ctx context.Context, name, swaggerVersion, locale string) RequestItem
func (*Service) RequestItemSLA ¶
func (svc *Service) RequestItemSLA(ctx context.Context, name, locale string) RequestItem
RequestItemSLA
func (*Service) SearchOperations ¶
func (svc *Service) SearchOperations(req *apistructs.SearchOperationsReq) (results []*apistructs.APIOAS3IndexModel, apiError *errorresp.APIError)
func (*Service) UpdateAPIAsset ¶
func (svc *Service) UpdateAPIAsset(req *apistructs.UpdateAPIAssetReq) *errorresp.APIError
func (*Service) UpdateAccess ¶
func (svc *Service) UpdateAccess(ctx context.Context, req *apistructs.UpdateAccessReq) (*apistructs.APIAccessesModel, *errorresp.APIError)
func (*Service) UpdateAssetVersion ¶
func (svc *Service) UpdateAssetVersion(ctx context.Context, req *apistructs.UpdateAssetVersionReq) (*apistructs.APIAssetVersionsModel, *errorresp.APIError)
修改 asset version
func (*Service) UpdateClient ¶
func (svc *Service) UpdateClient(req *apistructs.UpdateClientReq) (*apistructs.ClientModel, *apistructs.SK, *errorresp.APIError)
func (*Service) UpdateContract ¶
func (svc *Service) UpdateContract(ctx context.Context, req *apistructs.UpdateContractReq) (*apistructs.ClientModel, *apistructs.ContractModel, *errorresp.APIError)
func (*Service) UpdateInstantiation ¶
func (svc *Service) UpdateInstantiation(ctx context.Context, req *apistructs.UpdateInstantiationReq) (*apistructs.InstantiationModel, *errorresp.APIError)
func (*Service) UpdateSLA ¶
func (svc *Service) UpdateSLA(ctx context.Context, req *apistructs.UpdateSLAReq) *errorresp.APIError
Click to show internal directories.
Click to hide internal directories.