apiary/honeypot/ports/store.go
2021-10-28 16:09:28 +02:00

27 lines
467 B
Go

package ports
type ConnectionAttempt struct {
Port string
Network string
From string
Data []byte
}
type Store interface {
Add(attempt *ConnectionAttempt) error
List() ([]*ConnectionAttempt, error)
}
type MemoryStore struct {
data []*ConnectionAttempt
}
func (s *MemoryStore) Add(attempt *ConnectionAttempt) error {
s.data = append(s.data, attempt)
return nil
}
func (s *MemoryStore) List() ([]*ConnectionAttempt, error) {
return s.data, nil
}