Skip to content

Instantly share code, notes, and snippets.

@rishabh-gupta2
Created March 30, 2021 11:58
Show Gist options
  • Save rishabh-gupta2/3e5d6918a499ee7f63b56d8127bba82d to your computer and use it in GitHub Desktop.
Save rishabh-gupta2/3e5d6918a499ee7f63b56d8127bba82d to your computer and use it in GitHub Desktop.
Encoder interface
// Encoder holds the details on JobHandler which are registered with Outboxer.
// and is responsible for serialization and deserialization of JobHandler.
type Encoder interface {
// Encode serialize any registered interface to a string.
Encode(handler interface{}) (string, error)
// Decode deserialize a valid encoded string to its interface.
Decode(content string) (interface{}, error)
// Register registers interfaces which will be serialized.
Register(handlerName string, handler interface{}) error
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment