metadata

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2024 License: MIT Imports: 7 Imported by: 0

README

metadata

type Metadata
type Metadata struct {
	KeeperType  string                   `json:"type"`
	Created     time.Time                `json:"created,omitempty"`
	LastOpened  time.Time                `json:"last_opened,omitempty"`
	KnownStores []string                 `json:"stores,omitempty"`
	Backups     map[string]models.Backup `json:"backups,omitempty"`
}

Metadata is a struct that holds the metadata for a [Keeper]'s DB. This is critical for migrating data between [Keeper]s. The only absolute requirement is that the [Type] field is set.

func NewMeta
func NewMeta(keeperType string) *Metadata
func NewMetaFile
func NewMetaFile(keeperType, path string) (*Metadata, error)
func OpenMetaFile
func OpenMetaFile(path string) (*Metadata, error)
func (*Metadata) AddStore
func (m *Metadata) AddStore(name string)
func (*Metadata) Close
func (m *Metadata) Close() error
func (*Metadata) Ping
func (m *Metadata) Ping()
func (*Metadata) RemoveStore
func (m *Metadata) RemoveStore(name string)
func (*Metadata) Sync
func (m *Metadata) Sync() error
func (*Metadata) Timestamp
func (m *Metadata) Timestamp() time.Time
func (*Metadata) Type
func (m *Metadata) Type() string
func (*Metadata) WithBackups
func (m *Metadata) WithBackups(backups ...models.Backup) *Metadata
func (*Metadata) WithCreated
func (m *Metadata) WithCreated(created time.Time) *Metadata
func (*Metadata) WithLastOpened
func (m *Metadata) WithLastOpened(lastOpened time.Time) *Metadata
func (*Metadata) WithStores
func (m *Metadata) WithStores(stores ...string) *Metadata
func (*Metadata) WithWriter
func (m *Metadata) WithWriter(w io.WriteCloser) *Metadata

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metadata

type Metadata struct {
	KeeperType  string                   `json:"type"`
	Created     time.Time                `json:"created,omitempty"`
	LastOpened  time.Time                `json:"last_opened,omitempty"`
	KnownStores []string                 `json:"stores,omitempty"`
	Backups     map[string]models.Backup `json:"backups,omitempty"`
	// contains filtered or unexported fields
}

Metadata is a struct that holds the metadata for a [Keeper]'s DB. This is critical for migrating data between [Keeper]s. The only absolute requirement is that the [Type] field is set.

func NewMeta

func NewMeta(keeperType string) *Metadata

func NewMetaFile

func NewMetaFile(keeperType, path string) (*Metadata, error)

func OpenMetaFile

func OpenMetaFile(path string) (*Metadata, error)

func (*Metadata) AddStore

func (m *Metadata) AddStore(name string)

func (*Metadata) Close

func (m *Metadata) Close() error

func (*Metadata) Ping

func (m *Metadata) Ping()

func (*Metadata) RemoveStore

func (m *Metadata) RemoveStore(name string)

func (*Metadata) Sync

func (m *Metadata) Sync() error

func (*Metadata) Timestamp

func (m *Metadata) Timestamp() time.Time

func (*Metadata) Type

func (m *Metadata) Type() string

func (*Metadata) WithBackups

func (m *Metadata) WithBackups(backups ...models.Backup) *Metadata

func (*Metadata) WithCreated

func (m *Metadata) WithCreated(created time.Time) *Metadata

func (*Metadata) WithLastOpened

func (m *Metadata) WithLastOpened(lastOpened time.Time) *Metadata

func (*Metadata) WithStores

func (m *Metadata) WithStores(stores ...string) *Metadata

func (*Metadata) WithWriter

func (m *Metadata) WithWriter(w io.WriteCloser) *Metadata

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL