mirror of
https://github.com/docker/docker-agent.git
synced 2026-11-06 15:07:58 +00:00
29 lines
597 B
Go
29 lines
597 B
Go
package database
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
)
|
|
|
|
var (
|
|
ErrEmptyID = errors.New("memory ID cannot be empty")
|
|
)
|
|
|
|
type UserMemory struct {
|
|
ID string
|
|
CreatedAt string
|
|
Memory string
|
|
}
|
|
|
|
type Memory interface {
|
|
AddMemory(ctx context.Context, memory UserMemory) error
|
|
GetMemories(ctx context.Context) ([]UserMemory, error)
|
|
DeleteMemory(ctx context.Context, memory UserMemory) error
|
|
}
|
|
|
|
type Database interface {
|
|
AddMemory(ctx context.Context, memory UserMemory) error
|
|
GetMemories(ctx context.Context) ([]UserMemory, error)
|
|
DeleteMemory(ctx context.Context, memory UserMemory) error
|
|
}
|