assetsvc

package
v1.3.0-rc.0...-d217119 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 40 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

func Json2Yaml

func Json2Yaml(data []byte) []byte

func Oas2Json

func Oas2Json(data []byte) []byte

func Oas2Yaml

func Oas2Yaml(data []byte) []byte

func Oas3Json

func Oas3Json(data []byte) []byte

func Oas3Yaml

func Oas3Yaml(data []byte) []byte

func OnceADayLimitType

func OnceADayLimitType() []apistructs.LimitType

func V3ToCsv

func V3ToCsv(v3 *openapi3.Swagger, assetID, assetName, versionName string, major, minor, patch uint64,
	creator, updater, createdAt, updatedAt string) ([]byte, *errorresp.APIError)

func Yaml2Json

func Yaml2Json(data []byte) []byte

Types

type Action

type Action string

通知消息中的 action 参数

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

func WithBundle(bdl *bundle.Bundle) Option

func WithI18n

func WithI18n(translator i18n.Translator) Option

WithI18n sets the i18n client

func WithOrg

func WithOrg(org org.Interface) Option

type RequestItem

type RequestItem string

type Service

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

func New

func New(opts ...Option) *Service

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 (svc *Service) CheckClientIDSecret(orgID, userID, clientID, clientSecret string) error

func (*Service) CreateAPIAsset

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

CreateAPIAsset 创建 API 资料

func (*Service) CreateAPIAssetVersion

CreateAPIAssetVersion 创建 API 资料版本

func (*Service) CreateAccess

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

func (*Service) CreateClient

func (*Service) CreateContract

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

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 (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

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) 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 (svc *Service) MboxNotify(title, templateName string, params map[string]string, locale string, orgID uint64, users []string) error

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

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

修改 asset version

func (*Service) UpdateClient

func (*Service) UpdateSLA

func (svc *Service) UpdateSLA(ctx context.Context, req *apistructs.UpdateSLAReq) *errorresp.APIError

Jump to

Keyboard shortcuts

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