Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ActionFactory ¶
type ActionFactory func(jsonAction *json.RawMessage) (common.Action, error)
ActionFactory is a function type that should be implemented by all Action factories. It defines a function that receives the JSON-encoded Action object (in raw bytes), and it returs the corresponding Action object, including any initializations required such as dependency injection.
type ActionWrapper ¶
ActionWrapper provides a structure that holds an Action together with its type.
func Wrapper ¶
func Wrapper(action common.Action) (*ActionWrapper, error)
Wrapper creates an ActionWrapper for the given Action, based on its type that is detected via reflection.
func (*ActionWrapper) UnmarshalJSON ¶
func (wrapper *ActionWrapper) UnmarshalJSON(bytes []byte) error
UnmarshalJSON properly decodes an ActionWrapper JSON object by decoding the contained Action depending on the value of the "type" field.
Click to show internal directories.
Click to hide internal directories.