Documentation
¶
Overview ¶
package dbclient defines operations about database
Index ¶
- Constants
- func CheckVersionConflict(orgID uint64, assetID string, major, minor, patch uint64) (result [][3]uint64, ok bool, err error)
- func Close() error
- func CreateOrUpdateAPIAssetVersionSpec(spec *APIAssetVersionSpecsModel) error
- func DeleteAPIAssetByOrgAssetID(orgID uint64, assetID string, cascade bool) error
- func DeleteAPIAssetVersion(orgID uint64, assetID string, versionID uint64, cascade bool) error
- func FirstOrCreateInstantiation(model *apistructs.InstantiationModel, params map[string]interface{}) error
- func GenSemVer(orgID uint64, assetID, swaggerVersion string, major, minor, patch *uint64) error
- func GetAPIAssetVersion(req *apistructs.GetAPIAssetVersionReq) (*apistructs.APIAssetVersionsModel, error)
- func GetContract(req *apistructs.GetContractReq) (*apistructs.ContractModel, error)
- func GetMyClient(req *apistructs.GetClientReq, orgManager bool) (*apistructs.ClientModel, error)
- func ListAccess(req *apistructs.ListAccessReq, responsibleAssetIDs []string) (uint64, []*apistructs.ListAccessObj, error)
- func ListContractRecords(req *apistructs.ListContractRecordsReq) ([]*apistructs.ContractRecordModel, error)
- func ListContracts(req *apistructs.ListContractsReq) (uint64, []*apistructs.ContractModelAdvance, error)
- func ListMyClients(req *apistructs.ListMyClientsReq, orgManager bool) (total uint64, models []*apistructs.ClientModel, err error)
- func ListSwaggerVersionClients(req *apistructs.ListSwaggerVersionClientsReq) ([]*apistructs.ListSwaggerVersionClientOjb, error)
- func OneInstantiation(model *apistructs.InstantiationModel, params map[string]interface{}) error
- func Open() error
- func PagingAPIAssetVersions(req *apistructs.PagingAPIAssetVersionsReq) (uint64, []*apistructs.APIAssetVersionsModel, error)
- func QueryAPILatestVersion(orgID uint64, assetID string) (*apistructs.APIAssetVersionsModel, error)
- func QuerySpecsFromVersions(orgID uint64, assetID string, versionIDs []string, ...) error
- func QueryVersionLatestSpec(orgID, versionID uint64) (*apistructs.APIAssetVersionSpecsModel, error)
- func Sq() *gorm.DB
- func UpdateInstantiation(req *apistructs.UpdateInstantiationReq) error
- type APIAssetVersionSpecsModel
- type APIAssetsModel
- type APITestEnv
- type DBClient
- type TX
Constants ¶
View Source
const DistinctAssetIDFromAccess = `` /* 191-byte string literal not displayed */
View Source
const SelectFoundRows = `
SELECT FOUND_ROWS()
`
Variables ¶
This section is empty.
Functions ¶
func CheckVersionConflict ¶
func CheckVersionConflict(orgID uint64, assetID string, major, minor, patch uint64) (result [][3]uint64, ok bool, err error)
CheckVersionConflict checks out all versions of the major, determines if there is a version number conflict. ok is true means no conflict.
func CreateOrUpdateAPIAssetVersionSpec ¶
func CreateOrUpdateAPIAssetVersionSpec(spec *APIAssetVersionSpecsModel) error
func DeleteAPIAssetByOrgAssetID ¶
DeleteAPIAssetByOrgAssetID deletes the APIAsset and APIAssetVersion record for giving assetID
func DeleteAPIAssetVersion ¶
DeleteAPIAssetVersion deletes a APIAssetVersion record
func FirstOrCreateInstantiation ¶
func FirstOrCreateInstantiation(model *apistructs.InstantiationModel, params map[string]interface{}) error
func GetAPIAssetVersion ¶
func GetAPIAssetVersion(req *apistructs.GetAPIAssetVersionReq) (*apistructs.APIAssetVersionsModel, error)
func GetContract ¶
func GetContract(req *apistructs.GetContractReq) (*apistructs.ContractModel, error)
func GetMyClient ¶
func GetMyClient(req *apistructs.GetClientReq, orgManager bool) (*apistructs.ClientModel, error)
GetMyClient select a Client details
func ListAccess ¶
func ListAccess(req *apistructs.ListAccessReq, responsibleAssetIDs []string) (uint64, []*apistructs.ListAccessObj, error)
func ListContractRecords ¶
func ListContractRecords(req *apistructs.ListContractRecordsReq) ([]*apistructs.ContractRecordModel, error)
func ListContracts ¶
func ListContracts(req *apistructs.ListContractsReq) (uint64, []*apistructs.ContractModelAdvance, error)
func ListMyClients ¶
func ListMyClients(req *apistructs.ListMyClientsReq, orgManager bool) (total uint64, models []*apistructs.ClientModel, err error)
func ListSwaggerVersionClients ¶
func ListSwaggerVersionClients(req *apistructs.ListSwaggerVersionClientsReq) ([]*apistructs.ListSwaggerVersionClientOjb, error)
func OneInstantiation ¶
func OneInstantiation(model *apistructs.InstantiationModel, params map[string]interface{}) error
func PagingAPIAssetVersions ¶
func PagingAPIAssetVersions(req *apistructs.PagingAPIAssetVersionsReq) (uint64, []*apistructs.APIAssetVersionsModel, error)
func QueryAPILatestVersion ¶
func QueryAPILatestVersion(orgID uint64, assetID string) (*apistructs.APIAssetVersionsModel, error)
func QuerySpecsFromVersions ¶
func QuerySpecsFromVersions(orgID uint64, assetID string, versionIDs []string, m map[uint64]*apistructs.PagingAPIAssetVersionRspObj) error
func QueryVersionLatestSpec ¶
func QueryVersionLatestSpec(orgID, versionID uint64) (*apistructs.APIAssetVersionSpecsModel, error)
func UpdateInstantiation ¶
func UpdateInstantiation(req *apistructs.UpdateInstantiationReq) error
Types ¶
type APIAssetVersionSpecsModel ¶
type APIAssetVersionSpecsModel apistructs.APIAssetVersionSpecsModel
APIAssetVersionSpec is dice_api_asset_version_specs model
func GetAPIAssetVersionSpec ¶
func GetAPIAssetVersionSpec(req *apistructs.GetAPIAssetVersionReq) (*APIAssetVersionSpecsModel, error)
func (APIAssetVersionSpecsModel) TableName ¶
func (m APIAssetVersionSpecsModel) TableName() string
type APIAssetsModel ¶
type APIAssetsModel apistructs.APIAssetsModel
APIAsset is dice_api_assets model
func GetAPIAsset ¶
func GetAPIAsset(req *apistructs.GetAPIAssetReq) (*APIAssetsModel, error)
func (APIAssetsModel) TableName ¶
func (APIAssetsModel) TableName() string
type APITestEnv ¶
type APITestEnv struct {
ID int64 `xorm:"pk autoincr" json:"id"`
CreatedAt time.Time `xorm:"created" json:"createdAt"`
UpdatedAt time.Time `xorm:"updated" json:"updatedAt"`
EnvID int64 `xorm:"env_id" json:"envID"`
EnvType string `xorm:"env_type" json:"envType"`
Name string `xorm:"name" json:"name"`
Domain string `xorm:"domain" json:"domain"`
Header string `xorm:"header" json:"header"`
Global string `xorm:"global" json:"global"`
}
APITestEnv maintains envs about API
func GetTestEnv ¶
func GetTestEnv(envID int64) (*APITestEnv, error)
func GetTestEnvListByEnvID ¶
func GetTestEnvListByEnvID(envID int64, envType string) ([]APITestEnv, error)
Click to show internal directories.
Click to hide internal directories.