Add embedded interface
This commit is contained in:
@@ -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"`
|
||||||
|
|||||||
Reference in New Issue
Block a user