mima

package
v0.0.0-...-4a985ec Latest Latest
Warning

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

Go to latest
Published: May 6, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EditForm

type EditForm struct {
	ID       string
	Title    string
	Alias    string
	Username string
	Password string
	Notes    string
}

type History

type History struct {
	Title    string
	Username string
	Password string
	Notes    string
	DateTime string
}

type Mima

type Mima struct {
	ID        string
	Title     string
	Alias     string
	Username  string
	Password  string
	Notes     string
	CreatedAt string // ISO8601
	UpdatedAt string
	DeletedAt string
	Operation Operation
	History   []*History
}

func NewFrom

func NewFrom(form *EditForm) *Mima

func (*Mima) Delete

func (m *Mima) Delete()

Delete soft-delete itself.

func (*Mima) DeleteHistory

func (m *Mima) DeleteHistory(datetime string) error

func (*Mima) HideSecrets

func (m *Mima) HideSecrets() *Mima

func (*Mima) IsDeleted

func (m *Mima) IsDeleted() bool

func (*Mima) UnDelete

func (m *Mima) UnDelete()

func (*Mima) UpdateFromForm

func (m *Mima) UpdateFromForm(form *EditForm) (changeIndex, writeFrag bool)

func (*Mima) UpdateFromFrag

func (m *Mima) UpdateFromFrag(fragment *Mima) (changeIndex bool)

UpdateFromFrag updates m when fragment.Operation is Update.

type MimaWithHistory

type MimaWithHistory struct {
	OutputMima
	History []OutputHistory
}

func MWH_From

func MWH_From(m *Mima) (mwh MimaWithHistory)

type Operation

type Operation int
const (
	Insert Operation = iota + 1
	Update
	SoftDelete
	UnDelete
	DeleteForever
)

type OutputHistory

type OutputHistory struct {
	ID       string
	MimaID   string
	Title    string
	Username string
	Password string
	Notes    string
	CTime    int64
}

type OutputMima

type OutputMima struct {
	ID       string
	Title    string
	Label    string
	Username string
	Password string
	Notes    string
	CTime    int64
	MTime    int64
}

Jump to

Keyboard shortcuts

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