Documentation ¶
Index ¶
- type InMemoryState
- func (i *InMemoryState) AppendOperationEvent(event *pb.Operation_Event) error
- func (i *InMemoryState) GetOperationEvents(ref *pb.Ref_Operation) ([]*pb.Operation_Event, error)
- func (i *InMemoryState) GetOperationResponse(ref *pb.Ref_Operation) (*pb.Operation_Response, error)
- func (i *InMemoryState) UpsertOperationResponse(res *pb.Operation_Response) error
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InMemoryState ¶
type InMemoryState struct {
// contains filtered or unexported fields
}
InMemoryState is an implementation of our state that lives only in memory.
func NewInMemoryState ¶
func NewInMemoryState() *InMemoryState
NewInMemoryState returns a new InMemoryState.
func (*InMemoryState) AppendOperationEvent ¶
func (i *InMemoryState) AppendOperationEvent(event *pb.Operation_Event) error
AppendOperationEvent takes an operation event and appends it into the operations event history.
func (*InMemoryState) GetOperationEvents ¶
func (i *InMemoryState) GetOperationEvents( ref *pb.Ref_Operation, ) ( []*pb.Operation_Event, error, )
GetOperationEvents takes a reference to an operation and returns the entire event history.
func (*InMemoryState) GetOperationResponse ¶
func (i *InMemoryState) GetOperationResponse( ref *pb.Ref_Operation, ) ( *pb.Operation_Response, error, )
GetOperationResponse takes a reference to an operation and returns the most recent response.
func (*InMemoryState) UpsertOperationResponse ¶
func (i *InMemoryState) UpsertOperationResponse(res *pb.Operation_Response) error
UpsertOperationResponse takes and operation response and updates or inserts it into the response history.
type State ¶
type State interface { // GetOperationResponse returns the most recent committed operation response. GetOperationResponse(ref *pb.Ref_Operation) (*pb.Operation_Response, error) // UpsertOperationResponse updates or inserts the operation response. UpsertOperationResponse(res *pb.Operation_Response) error // GetOperationEvents returns an event history for the operation GetOperationEvents(ref *pb.Ref_Operation) ([]*pb.Operation_Event, error) // AppendOperationEvent appends an event into the operation event history AppendOperationEvent(ev *pb.Operation_Event) error }
State is our server state.
Click to show internal directories.
Click to hide internal directories.