mirror of
https://github.com/qdm12/ddns-updater.git
synced 2026-07-30 01:22:38 -04:00
22 lines
391 B
Go
22 lines
391 B
Go
package data
|
|
|
|
import (
|
|
"sync"
|
|
|
|
"github.com/qdm12/ddns-updater/internal/records"
|
|
)
|
|
|
|
type Database struct {
|
|
data []records.Record
|
|
sync.RWMutex
|
|
persistentDB PersistentDatabase
|
|
}
|
|
|
|
// NewDatabase creates a new in memory database.
|
|
func NewDatabase(data []records.Record, persistentDB PersistentDatabase) *Database {
|
|
return &Database{
|
|
data: data,
|
|
persistentDB: persistentDB,
|
|
}
|
|
}
|