github.com/Axway/agent-sdk@v1.1.101/pkg/cmd/agentsync/agentsync.go (about) 1 package agentsync 2 3 import ( 4 "github.com/Axway/agent-sdk/pkg/util/log" 5 ) 6 7 var agentSync AgentSync 8 9 func init() { 10 agentSync = &defaultAgentSync{} 11 } 12 13 // AgentSync - the interface discovery agents implement to handle the sync command line flag 14 type AgentSync interface { 15 ProcessSynchronization() error 16 } 17 18 type defaultAgentSync struct { 19 AgentSync 20 } 21 22 func (d *defaultAgentSync) ProcessSynchronization() error { 23 log.Warn("This is the default synchronization method") 24 return nil 25 } 26 27 // SetAgentSync - allows the agent to set the agent sync implementation for its gateway 28 func SetAgentSync(agentSyncImpl AgentSync) { 29 agentSync = agentSyncImpl 30 }