assetsvc

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Overview

Package asset API 资产

Index

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

This section is empty.

Types

type Action

type Action string

通知消息中的 action 参数

type ApprovalResult

type ApprovalResult string
const ManagerDeleteSLA ApprovalResult = "管理员撤销了你正在使用的 SLA, 请及时查看"
const ManagerProvedContract ApprovalResult = "同意调用"

func ApprovalResultFromStatus

func ApprovalResultFromStatus(status apistructs.ContractStatus) ApprovalResult

func ApprovalResultSLAUpdated

func ApprovalResultSLAUpdated(name string) ApprovalResult

approval results

func ApprovalResultWhileDelete

func ApprovalResultWhileDelete(status apistructs.ContractStatus) ApprovalResult

func ManagerRewriteSLA

func ManagerRewriteSLA(name string) ApprovalResult

type Option

type Option func(*Service)

func WithBranchRuleSvc

func WithBranchRuleSvc(svc *branchrule.BranchRule) Option

type RequestItem

type RequestItem string

func RequestItemAPI

func RequestItemAPI(name, swaggerVersion string) RequestItem

func RequestItemSLA

func RequestItemSLA(name string) RequestItem

RequestItemSLA

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(options ...Option) *Service

func (*Service) CheckClientIDSecret

func (svc *Service) CheckClientIDSecret(orgID, userID, clientID, clientSecret string) error

func (*Service) CreateAPIAsset

func (svc *Service) CreateAPIAsset(req apistructs.APIAssetCreateRequest) (apiAssetID string, err error)

CreateAPIAsset 创建 API 资料

func (*Service) CreateAPIAssetVersion

CreateAPIAssetVersion 创建 API 资料版本

func (*Service) CreateAccess

func (svc *Service) CreateAccess(req *apistructs.CreateAccessReq) (map[string]interface{}, *errorresp.APIError)

func (*Service) CreateClient

func (*Service) CreateContract

创建一个合约. 注意创建合约时, 需要查询客户端详情, 查询客户端详情时传入的 ClientID 是 dice_api_clients 的主键

func (*Service) CreateSLA

func (svc *Service) CreateSLA(req *apistructs.CreateSLAReq) *errorresp.APIError

func (*Service) DeleteAccess

func (svc *Service) DeleteAccess(req *apistructs.GetAccessReq) *errorresp.APIError

func (*Service) DeleteAssetByAssetID

func (svc *Service) DeleteAssetByAssetID(req apistructs.APIAssetDeleteRequest) error

DeleteAssetByAssetID 根据给定的 orgID 和 assetID 删除 APIAsset 表和 APIAssetVersionDetail 表的记录

func (*Service) DeleteAssetVersionByID

func (svc *Service) DeleteAssetVersionByID(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(req *apistructs.GetContractReq) *errorresp.APIError

DeleteContract deletes contract

func (*Service) DeleteSLA

func (svc *Service) DeleteSLA(req *apistructs.DeleteSLAReq) *errorresp.APIError

func (*Service) DownloadSpecText

func (svc *Service) DownloadSpecText(req *apistructs.DownloadSpecTextReq) ([]byte, *errorresp.APIError)

func (*Service) EmailNotify

func (svc *Service) EmailNotify(title, templateName string, params map[string]string, locale string, orgID uint64, userIDs []string) error

func (*Service) FirstRecord

func (svc *Service) FirstRecord(model interface{}, where map[string]interface{}) error

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

GetAsset 查询 API 资料

func (*Service) GetAssetVersion

GetAssetVersion 查询 API 资料版本

func (*Service) GetEndpointDomains

func (svc *Service) GetEndpointDomains(orgID, userID, endpointID string) []string

func (*Service) GetInstantiation

查询 minor 下的 instantiation ok: 是否存在这样的实例化记录, true: 存在

func (*Service) GetMyClient

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 (svc *Service) GetRuntimeServices(runtimeID uint64, orgID uint64, userID string) (*bundle.GetRuntimeServicesResponseData, error)

func (*Service) GetSLA

func (*Service) ListAPIGateways

func (svc *Service) ListAPIGateways(req *apistructs.ListAPIGatewaysReq) ([]map[string]string, *errorresp.APIError)

func (*Service) ListAccess

func (*Service) ListContracts

func (*Service) ListMyClients

func (*Service) ListProjectAPIGateways

func (svc *Service) ListProjectAPIGateways(req *apistructs.ListProjectAPIGatewaysReq) ([]map[string]string, *errorresp.APIError)

func (*Service) ListRecords

func (svc *Service) ListRecords(models interface{}, where map[string]interface{}) error

func (*Service) ListSLAs

查询 SLA 列表

func (*Service) ListSwaggerVersions

func (*Service) MboxNotify

func (svc *Service) MboxNotify(title, templateName string, params map[string]string, locale string, orgID uint64, users []string) error

func (*Service) PagingAPIAssetVersions

func (svc *Service) PagingAPIAssetVersions(req *apistructs.PagingAPIAssetVersionsReq) (responseData *apistructs.PagingAPIAssetVersionResponse, userIDs []string, err error)

PagingAPIAssetVersions 获取 API 资料版本列表

func (*Service) PagingAsset

PagingAsset 分页查询 API 资料

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 (*Service) UpdateAssetVersion

修改 asset version

func (*Service) UpdateClient

func (*Service) UpdateSLA

func (svc *Service) UpdateSLA(req *apistructs.UpdateSLAReq) *errorresp.APIError

Jump to

Keyboard shortcuts

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