Documentation
¶
Overview ¶
Package memento is an example of the Memento Pattern.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Caretaker ¶
type Caretaker struct {
Memento *Memento
}
Caretaker keeps Memento until it is needed by Originator.
type Memento ¶
type Memento struct {
// contains filtered or unexported fields
}
Memento implements storage for the state of Originator
type Originator ¶
type Originator struct {
State string
}
Originator implements a state master.
func (*Originator) CreateMemento ¶
func (o *Originator) CreateMemento() *Memento
CreateMemento returns state storage.
func (*Originator) SetMemento ¶
func (o *Originator) SetMemento(memento *Memento)
SetMemento sets old state.
Click to show internal directories.
Click to hide internal directories.