service

package
v3.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2018 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertCallback

func AssertCallback(t *testing.T, svc func(request *restful.Request, response *restful.Response), requestBody string, callback func(responseBody string, status int) error)

func AssertCases

func AssertCases(t *testing.T, svc func(request *restful.Request, response *restful.Response), cases []*TestCase)

func AssertEqual

func AssertEqual(t *testing.T, svc func(request *restful.Request, response *restful.Response), requestBody string, expectResponseBody string, expectStatus int)

func CallService

func CallService(svc func(request *restful.Request, response *restful.Response), requestBody string) (response *restful.Response, responseBody string)

Types

type Service

type Service struct {
	Core     *backbone.Engine
	Instance storage.DI
	Cache    *redis.Client
}

func NewMockService

func NewMockService() *Service

func (*Service) CreateClassification

func (cli *Service) CreateClassification(req *restful.Request, resp *restful.Response)

CreateClassification create object's classification

func (*Service) CreateInstObject

func (cli *Service) CreateInstObject(req *restful.Request, resp *restful.Response)

CreateInstObject CreateInstObject

func (*Service) CreateObject

func (cli *Service) CreateObject(req *restful.Request, resp *restful.Response)

CreateObject create a common object

func (*Service) CreateObjectAssociation

func (cli *Service) CreateObjectAssociation(req *restful.Request, resp *restful.Response)

CreateObjectAssociation create object association map

func (*Service) CreateObjectAtt

func (cli *Service) CreateObjectAtt(req *restful.Request, resp *restful.Response)

CreateObjectAtt create object's attribute

func (*Service) CreateObjectIntoDB

func (cli *Service) CreateObjectIntoDB(objType string, input interface{}, idName *string) (int, error)

CreateObjectIntoDB add new object

func (*Service) CreatePropertyGroup

func (cli *Service) CreatePropertyGroup(req *restful.Request, resp *restful.Response)

CreatePropertyGroup to create property group

func (*Service) CreateRolePri

func (cli *Service) CreateRolePri(req *restful.Request, resp *restful.Response)

CreateRolePri create role privilege

func (*Service) CreateUserGroup

func (cli *Service) CreateUserGroup(req *restful.Request, resp *restful.Response)

CreateUserGroup create group

func (*Service) CreateUserGroupPrivi

func (cli *Service) CreateUserGroupPrivi(req *restful.Request, resp *restful.Response)

CreateUserGroupPrivi create group privi

func (*Service) DelObjByCondition

func (cli *Service) DelObjByCondition(objType string, condition interface{}) error

func (*Service) DeleteClassification

func (cli *Service) DeleteClassification(req *restful.Request, resp *restful.Response)

DeleteClassification delete object's classification

func (*Service) DeleteInstObject

func (cli *Service) DeleteInstObject(req *restful.Request, resp *restful.Response)

DeleteInstObject DeleteInstObject

func (*Service) DeleteObject

func (cli *Service) DeleteObject(req *restful.Request, resp *restful.Response)

删除Object

func (*Service) DeleteObjectAssociation

func (cli *Service) DeleteObjectAssociation(req *restful.Request, resp *restful.Response)

DeleteObjectAssociation delete object association map

func (*Service) DeleteObjectAttByID

func (cli *Service) DeleteObjectAttByID(req *restful.Request, resp *restful.Response)

DeleteObjectAttByID delete object's attribute by id

func (*Service) DeletePropertyGroup

func (cli *Service) DeletePropertyGroup(req *restful.Request, resp *restful.Response)

DeletePropertyGroup to update property group

func (*Service) DeletePropertyGroupObjectAtt

func (cli *Service) DeletePropertyGroupObjectAtt(req *restful.Request, resp *restful.Response)

DeletePropertyGroupObjectAtt to delete property group object attribute

func (*Service) DeleteSetHost

func (cli *Service) DeleteSetHost(req *restful.Request, resp *restful.Response)

func (*Service) DeleteUserGroup

func (cli *Service) DeleteUserGroup(req *restful.Request, resp *restful.Response)

DeleteUserGroup create group

func (*Service) GetCntByCondition

func (cli *Service) GetCntByCondition(objType string, condition interface{}) (int, error)

GetCntByCondition get count by condition

func (*Service) GetHostByCondition

func (cli *Service) GetHostByCondition(fields []string, condition, result interface{}, sort string, skip, limit int) error

GetHostByCondition query

func (*Service) GetIdleModule

func (cli *Service) GetIdleModule(appID interface{}, ownerID string) (interface{}, interface{}, error)

func (*Service) GetObjectByCondition

func (cli *Service) GetObjectByCondition(defLang language.DefaultCCLanguageIf, objType string, fields []string, condition, result interface{}, sort string, skip, limit int) error

GetObjectByCondition get object by condition

func (*Service) GetObjectByID

func (cli *Service) GetObjectByID(objType string, fields []string, id int, result interface{}, sort string) error

GetObjectByID get object by id

func (*Service) GetProcessesByModuleName

func (cli *Service) GetProcessesByModuleName(req *restful.Request, resp *restful.Response)

func (*Service) GetRolePri

func (cli *Service) GetRolePri(req *restful.Request, resp *restful.Response)

GetRolePri get role privilege

func (*Service) GetSystemFlag

func (cli *Service) GetSystemFlag(req *restful.Request, resp *restful.Response)

GetSystemFlag get the system define flag

func (*Service) GetUserGroupPrivi

func (cli *Service) GetUserGroupPrivi(req *restful.Request, resp *restful.Response)

GetUserGroupPrivi get group privi

func (*Service) Healthz

func (s *Service) Healthz(req *restful.Request, resp *restful.Response)

func (*Service) SearchIdentifier

func (cli *Service) SearchIdentifier(req *restful.Request, resp *restful.Response)

search object

func (*Service) SearchInstObjects

func (cli *Service) SearchInstObjects(req *restful.Request, resp *restful.Response)

SearchInstObjects SearchInstObjects

func (*Service) SearchTopoGraphics

func (cli *Service) SearchTopoGraphics(req *restful.Request, resp *restful.Response)

CreateClassification create object's classification

func (*Service) SearchUserGroup

func (cli *Service) SearchUserGroup(req *restful.Request, resp *restful.Response)

SearchUserGroup create group

func (*Service) SelectClassificationWithObject

func (cli *Service) SelectClassificationWithObject(req *restful.Request, resp *restful.Response)

SelectClassificationWithObject select objects by classification information

func (*Service) SelectClassifications

func (cli *Service) SelectClassifications(req *restful.Request, resp *restful.Response)

SelectClassifications select object's classification informations

func (*Service) SelectGroup

func (cli *Service) SelectGroup(req *restful.Request, resp *restful.Response)

SelectGroup search groups

func (*Service) SelectObjectAssociations

func (cli *Service) SelectObjectAssociations(req *restful.Request, resp *restful.Response)

SelectObjectAssociations search all object association map

func (*Service) SelectObjectAttByID

func (cli *Service) SelectObjectAttByID(req *restful.Request, resp *restful.Response)

SelectObjectAttByID select object's attribute by id

func (*Service) SelectObjectAttWithParams

func (cli *Service) SelectObjectAttWithParams(req *restful.Request, resp *restful.Response)

SelectObjectAttWithParams select object's attribute with some params

func (*Service) SelectObjects

func (cli *Service) SelectObjects(req *restful.Request, resp *restful.Response)

查询所有主机信息

func (*Service) SelectPropertyGroupByObjectID

func (cli *Service) SelectPropertyGroupByObjectID(req *restful.Request, resp *restful.Response)

SelectPropertyGroupByObjectID to search

func (*Service) TranslateClassificationName

func (cli *Service) TranslateClassificationName(defLang language.DefaultCCLanguageIf, att *meta.Classification) string

func (*Service) TranslateDescription

func (cli *Service) TranslateDescription(defLang language.DefaultCCLanguageIf, att *meta.Attribute) string

func (*Service) TranslateEnumName

func (cli *Service) TranslateEnumName(defLang language.DefaultCCLanguageIf, att *meta.Attribute, val interface{}) interface{}

func (*Service) TranslateInstName

func (cli *Service) TranslateInstName(defLang language.DefaultCCLanguageIf, obj *meta.Object) string

func (*Service) TranslateObjectName

func (cli *Service) TranslateObjectName(defLang language.DefaultCCLanguageIf, obj *meta.Object) string

func (*Service) TranslatePropertyGroupName

func (cli *Service) TranslatePropertyGroupName(defLang language.DefaultCCLanguageIf, att *meta.Group) string

func (*Service) TranslatePropertyName

func (cli *Service) TranslatePropertyName(defLang language.DefaultCCLanguageIf, att *meta.Attribute) string

func (*Service) UpdateClassification

func (cli *Service) UpdateClassification(req *restful.Request, resp *restful.Response)

UpdateClassification update object's classification information

func (*Service) UpdateInstObject

func (cli *Service) UpdateInstObject(req *restful.Request, resp *restful.Response)

UpdateInstObject UpdateInstObject

func (*Service) UpdateObjByCondition

func (cli *Service) UpdateObjByCondition(objType string, data interface{}, condition interface{}) error

UpdateObjByCondition update object by condition

func (*Service) UpdateObject

func (cli *Service) UpdateObject(req *restful.Request, resp *restful.Response)

func (*Service) UpdateObjectAssociation

func (cli *Service) UpdateObjectAssociation(req *restful.Request, resp *restful.Response)

UpdateObjectAssociation update object association map

func (*Service) UpdateObjectAttByID

func (cli *Service) UpdateObjectAttByID(req *restful.Request, resp *restful.Response)

UpdateObjectAttByID update object's attribute by id

func (*Service) UpdatePropertyGroup

func (cli *Service) UpdatePropertyGroup(req *restful.Request, resp *restful.Response)

UpdatePropertyGroup to update property group

func (*Service) UpdatePropertyGroupObjectAtt

func (cli *Service) UpdatePropertyGroupObjectAtt(req *restful.Request, resp *restful.Response)

UpdatePropertyGroupObjectAtt to update property group object attribute

func (*Service) UpdateRolePri

func (cli *Service) UpdateRolePri(req *restful.Request, resp *restful.Response)

UpdateRolePri update role privilege

func (*Service) UpdateTopoGraphics

func (cli *Service) UpdateTopoGraphics(req *restful.Request, resp *restful.Response)

func (*Service) UpdateUserGroup

func (cli *Service) UpdateUserGroup(req *restful.Request, resp *restful.Response)

UpdateUserGroup create group

func (*Service) UpdateUserGroupPrivi

func (cli *Service) UpdateUserGroupPrivi(req *restful.Request, resp *restful.Response)

UpdateUserGroupPrivi update group privi

func (*Service) WebService

func (s *Service) WebService() *restful.WebService

type TestCase

type TestCase struct {
	RequestBody        string
	ExpectResponseBody string
	ExpectStatus       int
	Callback           func(responseBody string, status int) error
}

Jump to

Keyboard shortcuts

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