Better tracking of SFTP events
This commit is contained in:
@@ -82,6 +82,10 @@ func (ra RequestActivity) IP() string {
|
||||
return ra.ip
|
||||
}
|
||||
|
||||
func (ra *RequestActivity) User() string {
|
||||
return ra.user
|
||||
}
|
||||
|
||||
// SetUser clones the RequestActivity struct and sets a new user value on the copy
|
||||
// before returning it.
|
||||
func (ra RequestActivity) SetUser(u string) RequestActivity {
|
||||
|
||||
@@ -52,6 +52,24 @@ func (m *Manager) Client() remote.Client {
|
||||
return m.client
|
||||
}
|
||||
|
||||
// Len returns the count of servers stored in the manager instance.
|
||||
func (m *Manager) Len() int {
|
||||
m.mu.RLock()
|
||||
defer m.mu.RUnlock()
|
||||
return len(m.servers)
|
||||
}
|
||||
|
||||
// Keys returns all of the server UUIDs stored in the manager set.
|
||||
func (m *Manager) Keys() []string {
|
||||
m.mu.RLock()
|
||||
defer m.mu.RUnlock()
|
||||
keys := make([]string, len(m.servers))
|
||||
for i, s := range m.servers {
|
||||
keys[i] = s.ID()
|
||||
}
|
||||
return keys
|
||||
}
|
||||
|
||||
// Put replaces all the current values in the collection with the value that
|
||||
// is passed through.
|
||||
func (m *Manager) Put(s []*Server) {
|
||||
|
||||
Reference in New Issue
Block a user