Add embedded interface

This commit is contained in:
Archie Fox
2025-03-13 21:32:26 +03:00
parent b16d0da418
commit debf1eec22

View File

@@ -8,11 +8,20 @@ import (
"github.com/fatih/color" "github.com/fatih/color"
) )
type Db interface { type ByteReader interface {
Read() ([]byte, error) Read() ([]byte, error)
}
type ByteWriter interface {
Write([]byte) Write([]byte)
} }
// embedded interface
type Db interface {
ByteReader
ByteWriter
}
type Vault struct { type Vault struct {
Accounts []Account `json:"accounts"` Accounts []Account `json:"accounts"`
UpdatedAt time.Time `json:"updatedAt"` UpdatedAt time.Time `json:"updatedAt"`