Documentation ¶
Index ¶
- Variables
- func AddAgent(addedAgent *nqmModel.AgentForAdding) (*nqmModel.Agent, error)
- func AddAndGetPingtask(pm *nqmModel.PingtaskModify) *nqmModel.PingtaskView
- func AddTarget(newTarget *nqmModel.TargetForAdding) (*nqmModel.Target, error)
- func AssignPingtaskToAgentForAgent(aID int32, pID int32) (*nqmModel.Agent, error)
- func AssignPingtaskToAgentForPingtask(aID int32, pID int32) (*nqmModel.PingtaskView, error)
- func BuildCacheOfPingList(agentId int32, checkedTime time.Time) *nqmModel.PingListLog
- func DeleteCachedTargetsOfAgentById(idArg int32) *nqmModel.ClearCacheView
- func GetAgentById(agentId int32) *nqmModel.Agent
- func GetPingListFromCache(agent *nqmModel.NqmAgent, checkedTime time.Time) ([]commonModel.NqmTarget, *nqmModel.PingListLog)
- func GetPingtaskById(id int32) *nqmModel.PingtaskView
- func GetSimpleAgent1ById(agentId int32) *nqmModel.SimpleAgent1
- func GetSimpleTarget1ById(targetId int32) *nqmModel.SimpleTarget1
- func GetTargetById(targetId int32) *nqmModel.Target
- func ListAgents(query *nqmModel.AgentQuery, paging commonModel.Paging) ([]*nqmModel.Agent, *commonModel.Paging)
- func ListAgentsWithPingTask(query *nqmModel.AgentQueryWithPingTask, paging commonModel.Paging) ([]*nqmModel.AgentWithPingTask, *commonModel.Paging)
- func ListPingtasks(query *nqmModel.PingtaskQuery, paging commonModel.Paging) ([]*nqmModel.PingtaskView, *commonModel.Paging)
- func ListTargets(query *nqmModel.TargetQuery, paging commonModel.Paging) ([]*nqmModel.Target, *commonModel.Paging)
- func ListTargetsOfAgentById(query *nqmModel.TargetsOfAgentQuery, paging commonModel.Paging) (*nqmModel.TargetsOfAgent, *commonModel.Paging)
- func LoadEffectiveAgentsInProvince(provinceId int16) []*nqmModel.SimpleAgent1InCity
- func LoadSimpleAgent1sByFilter(filter *nqmModel.AgentFilter) []*nqmModel.SimpleAgent1
- func LoadSimpleTarget1sByFilter(filter *nqmModel.TargetFilter) []*nqmModel.SimpleTarget1
- func RefreshAgentInfo(agent *nqmModel.NqmAgent, checkedTime time.Time) *commonModel.NqmAgent
- func RemovePingtaskFromAgentForAgent(aID int32, pID int32) (*nqmModel.Agent, error)
- func RemovePingtaskFromAgentForPingtask(aID int32, pID int32) (*nqmModel.PingtaskView, error)
- func UpdateAgent(oldAgent *nqmModel.Agent, updatedAgent *nqmModel.AgentForAdding) (*nqmModel.Agent, error)
- func UpdateAndGetPingtask(id int32, pm *nqmModel.PingtaskModify) *nqmModel.PingtaskView
- func UpdateTarget(oldTarget *nqmModel.Target, updatedTarget *nqmModel.TargetForAdding) (*nqmModel.Target, error)
- type ErrDuplicatedNqmAgent
- type ErrDuplicatedNqmTarget
Constants ¶
This section is empty.
Variables ¶
View Source
var DbFacade *f.DbFacade
Functions ¶
func AddAgent ¶
func AddAgent(addedAgent *nqmModel.AgentForAdding) (*nqmModel.Agent, error)
Add and retrieve detail data of agent
Errors:
ErrDuplicatedNqmAgent - The agent is existing with the same connection id ErrNotInSameHierarchy - The city is not belonging to the province
func AddAndGetPingtask ¶
func AddAndGetPingtask(pm *nqmModel.PingtaskModify) *nqmModel.PingtaskView
func AddTarget ¶
func AddTarget(newTarget *nqmModel.TargetForAdding) (*nqmModel.Target, error)
Add and retrieve detail data of target
Errors:
ErrDuplicatedNqmTarget - The target is existing with the same host ErrNotInSameHierarchy - The city is not belonging to the province
func AssignPingtaskToAgentForPingtask ¶
func AssignPingtaskToAgentForPingtask(aID int32, pID int32) (*nqmModel.PingtaskView, error)
func BuildCacheOfPingList ¶
func BuildCacheOfPingList(agentId int32, checkedTime time.Time) *nqmModel.PingListLog
1. Update(or INSERT) the refresh time 2. Re-build the list of targets
func DeleteCachedTargetsOfAgentById ¶
func DeleteCachedTargetsOfAgentById(idArg int32) *nqmModel.ClearCacheView
Clear the cached targets of an agent by the agent's ID
func GetAgentById ¶
func GetPingListFromCache ¶
func GetPingListFromCache(agent *nqmModel.NqmAgent, checkedTime time.Time) ([]commonModel.NqmTarget, *nqmModel.PingListLog)
Gets the ping list from cache
func GetPingtaskById ¶
func GetPingtaskById(id int32) *nqmModel.PingtaskView
func GetSimpleAgent1ById ¶
func GetSimpleAgent1ById(agentId int32) *nqmModel.SimpleAgent1
func GetSimpleTarget1ById ¶
func GetSimpleTarget1ById(targetId int32) *nqmModel.SimpleTarget1
Gets the target object or nil if the id is not existing
func GetTargetById ¶
func ListAgents ¶
func ListAgents(query *nqmModel.AgentQuery, paging commonModel.Paging) ([]*nqmModel.Agent, *commonModel.Paging)
Lists the agents by query condition
func ListAgentsWithPingTask ¶
func ListAgentsWithPingTask(query *nqmModel.AgentQueryWithPingTask, paging commonModel.Paging) ([]*nqmModel.AgentWithPingTask, *commonModel.Paging)
Lists the agents by query condition
func ListPingtasks ¶
func ListPingtasks(query *nqmModel.PingtaskQuery, paging commonModel.Paging) ([]*nqmModel.PingtaskView, *commonModel.Paging)
Lists the pingtasks according to the query parameters
func ListTargets ¶
func ListTargets(query *nqmModel.TargetQuery, paging commonModel.Paging) ([]*nqmModel.Target, *commonModel.Paging)
func ListTargetsOfAgentById ¶
func ListTargetsOfAgentById(query *nqmModel.TargetsOfAgentQuery, paging commonModel.Paging) (*nqmModel.TargetsOfAgent, *commonModel.Paging)
Lists the targets of an agent by the agent's ID
func LoadEffectiveAgentsInProvince ¶
func LoadEffectiveAgentsInProvince(provinceId int16) []*nqmModel.SimpleAgent1InCity
func LoadSimpleAgent1sByFilter ¶
func LoadSimpleAgent1sByFilter(filter *nqmModel.AgentFilter) []*nqmModel.SimpleAgent1
func LoadSimpleTarget1sByFilter ¶
func LoadSimpleTarget1sByFilter(filter *nqmModel.TargetFilter) []*nqmModel.SimpleTarget1
Gets the targets by filter
func RefreshAgentInfo ¶
Inserts a new agent or updates existing one
returns true if the agent is enabled
func RemovePingtaskFromAgentForPingtask ¶
func RemovePingtaskFromAgentForPingtask(aID int32, pID int32) (*nqmModel.PingtaskView, error)
func UpdateAgent ¶
func UpdateAndGetPingtask ¶
func UpdateAndGetPingtask(id int32, pm *nqmModel.PingtaskModify) *nqmModel.PingtaskView
func UpdateTarget ¶
func UpdateTarget(oldTarget *nqmModel.Target, updatedTarget *nqmModel.TargetForAdding) (*nqmModel.Target, error)
Update and retrieve detail data of target
Types ¶
type ErrDuplicatedNqmAgent ¶
type ErrDuplicatedNqmAgent struct {
ConnectionId string
}
func (ErrDuplicatedNqmAgent) Error ¶
func (err ErrDuplicatedNqmAgent) Error() string
type ErrDuplicatedNqmTarget ¶
type ErrDuplicatedNqmTarget struct {
Host string
}
func (ErrDuplicatedNqmTarget) Error ¶
func (err ErrDuplicatedNqmTarget) Error() string
Click to show internal directories.
Click to hide internal directories.