Documentation ¶
Overview ¶
Package serialize provides a serialization structure to serialize and deserialize Signal objects into storeable and transportable bytes.
Index ¶
- type JSONPreKeyRecordSerializer
- type JSONPreKeySignalMessageSerializer
- type JSONSenderKeyDistributionMessageSerializer
- type JSONSenderKeyMessageSerializer
- type JSONSenderKeySessionSerializer
- type JSONSenderKeyStateSerializer
- type JSONSessionSerializer
- type JSONSignalMessageSerializer
- type JSONSignedPreKeyRecordSerializer
- type JSONStateSerializer
- type Serializer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JSONPreKeyRecordSerializer ¶
type JSONPreKeyRecordSerializer struct{}
JSONPreKeyRecordSerializer is a structure for serializing prekey records into and from JSON.
func (*JSONPreKeyRecordSerializer) Deserialize ¶
func (j *JSONPreKeyRecordSerializer) Deserialize(serialized []byte) (*record.PreKeyStructure, error)
Deserialize will take in JSON bytes and return a prekey record structure.
func (*JSONPreKeyRecordSerializer) Serialize ¶
func (j *JSONPreKeyRecordSerializer) Serialize(preKey *record.PreKeyStructure) []byte
Serialize will take a prekey record structure and convert it to JSON bytes.
type JSONPreKeySignalMessageSerializer ¶
type JSONPreKeySignalMessageSerializer struct{}
JSONPreKeySignalMessageSerializer is a structure for serializing prekey signal messages into and from JSON.
func (*JSONPreKeySignalMessageSerializer) Deserialize ¶
func (j *JSONPreKeySignalMessageSerializer) Deserialize(serialized []byte) (*protocol.PreKeySignalMessageStructure, error)
Deserialize will take in JSON bytes and return a prekey signal message structure.
func (*JSONPreKeySignalMessageSerializer) Serialize ¶
func (j *JSONPreKeySignalMessageSerializer) Serialize(signalMessage *protocol.PreKeySignalMessageStructure) []byte
Serialize will take a prekey signal message structure and convert it to JSON bytes.
type JSONSenderKeyDistributionMessageSerializer ¶
type JSONSenderKeyDistributionMessageSerializer struct{}
JSONSenderKeyDistributionMessageSerializer is a structure for serializing senderkey distribution records to and from JSON.
func (*JSONSenderKeyDistributionMessageSerializer) Deserialize ¶
func (j *JSONSenderKeyDistributionMessageSerializer) Deserialize(serialized []byte) (*protocol.SenderKeyDistributionMessageStructure, error)
Deserialize will take in JSON bytes and return a message structure, which can be used to create a new SenderKey Distribution object.
func (*JSONSenderKeyDistributionMessageSerializer) Serialize ¶
func (j *JSONSenderKeyDistributionMessageSerializer) Serialize(message *protocol.SenderKeyDistributionMessageStructure) []byte
Serialize will take a senderkey distribution message and convert it to JSON bytes.
type JSONSenderKeyMessageSerializer ¶
type JSONSenderKeyMessageSerializer struct{}
JSONSenderKeyMessageSerializer is a structure for serializing senderkey messages to and from JSON.
func (*JSONSenderKeyMessageSerializer) Deserialize ¶
func (j *JSONSenderKeyMessageSerializer) Deserialize(serialized []byte) (*protocol.SenderKeyMessageStructure, error)
Deserialize will take in JSON bytes and return a message structure, which can be used to create a new SenderKey message object.
func (*JSONSenderKeyMessageSerializer) Serialize ¶
func (j *JSONSenderKeyMessageSerializer) Serialize(message *protocol.SenderKeyMessageStructure) []byte
Serialize will take a senderkey message and convert it to JSON bytes.
type JSONSenderKeySessionSerializer ¶
type JSONSenderKeySessionSerializer struct{}
JSONSenderKeySessionSerializer is a structure for serializing session records into and from JSON.
func (*JSONSenderKeySessionSerializer) Deserialize ¶
func (j *JSONSenderKeySessionSerializer) Deserialize(serialized []byte) (*groupRecord.SenderKeyStructure, error)
Deserialize will take in JSON bytes and return a session structure, which can be used to create a new Session Record object.
func (*JSONSenderKeySessionSerializer) Serialize ¶
func (j *JSONSenderKeySessionSerializer) Serialize(session *groupRecord.SenderKeyStructure) []byte
Serialize will take a session structure and convert it to JSON bytes.
type JSONSenderKeyStateSerializer ¶
type JSONSenderKeyStateSerializer struct{}
JSONSenderKeyStateSerializer is a structure for serializing group session states into and from JSON.
func (*JSONSenderKeyStateSerializer) Deserialize ¶
func (j *JSONSenderKeyStateSerializer) Deserialize(serialized []byte) (*groupRecord.SenderKeyStateStructure, error)
Deserialize will take in JSON bytes and return a session state structure.
func (*JSONSenderKeyStateSerializer) Serialize ¶
func (j *JSONSenderKeyStateSerializer) Serialize(state *groupRecord.SenderKeyStateStructure) []byte
Serialize will take a session state structure and convert it to JSON bytes.
type JSONSessionSerializer ¶
type JSONSessionSerializer struct{}
JSONSessionSerializer is a structure for serializing session records into and from JSON.
func (*JSONSessionSerializer) Deserialize ¶
func (j *JSONSessionSerializer) Deserialize(serialized []byte) (*record.SessionStructure, error)
Deserialize will take in JSON bytes and return a session structure, which can be used to create a new Session Record object.
func (*JSONSessionSerializer) Serialize ¶
func (j *JSONSessionSerializer) Serialize(session *record.SessionStructure) []byte
Serialize will take a session structure and convert it to JSON bytes.
type JSONSignalMessageSerializer ¶
type JSONSignalMessageSerializer struct{}
JSONSignalMessageSerializer is a structure for serializing signal messages into and from JSON.
func (*JSONSignalMessageSerializer) Deserialize ¶
func (j *JSONSignalMessageSerializer) Deserialize(serialized []byte) (*protocol.SignalMessageStructure, error)
Deserialize will take in JSON bytes and return a signal message structure.
func (*JSONSignalMessageSerializer) Serialize ¶
func (j *JSONSignalMessageSerializer) Serialize(signalMessage *protocol.SignalMessageStructure) []byte
Serialize will take a signal message structure and convert it to JSON bytes.
type JSONSignedPreKeyRecordSerializer ¶
type JSONSignedPreKeyRecordSerializer struct{}
JSONSignedPreKeyRecordSerializer is a structure for serializing signed prekey records into and from JSON.
func (*JSONSignedPreKeyRecordSerializer) Deserialize ¶
func (j *JSONSignedPreKeyRecordSerializer) Deserialize(serialized []byte) (*record.SignedPreKeyStructure, error)
Deserialize will take in JSON bytes and return a signed prekey record structure.
func (*JSONSignedPreKeyRecordSerializer) Serialize ¶
func (j *JSONSignedPreKeyRecordSerializer) Serialize(signedPreKey *record.SignedPreKeyStructure) []byte
Serialize will take a signed prekey record structure and convert it to JSON bytes.
type JSONStateSerializer ¶
type JSONStateSerializer struct{}
JSONStateSerializer is a structure for serializing session states into and from JSON.
func (*JSONStateSerializer) Deserialize ¶
func (j *JSONStateSerializer) Deserialize(serialized []byte) (*record.StateStructure, error)
Deserialize will take in JSON bytes and return a session state structure.
func (*JSONStateSerializer) Serialize ¶
func (j *JSONStateSerializer) Serialize(state *record.StateStructure) []byte
Serialize will take a session state structure and convert it to JSON bytes.
type Serializer ¶
type Serializer struct { SenderKeyRecord groupRecord.SenderKeySerializer SenderKeyState groupRecord.SenderKeyStateSerializer SignalMessage protocol.SignalMessageSerializer PreKeySignalMessage protocol.PreKeySignalMessageSerializer SenderKeyMessage protocol.SenderKeyMessageSerializer SenderKeyDistributionMessage protocol.SenderKeyDistributionMessageSerializer SignedPreKeyRecord record.SignedPreKeySerializer PreKeyRecord record.PreKeySerializer State record.StateSerializer Session record.SessionSerializer }
Serializer is a structure to serialize Signal objects into bytes. This allows you to use any serialization format to store or send Signal objects.
func NewJSONSerializer ¶
func NewJSONSerializer() *Serializer
NewJSONSerializer will return a serializer for all Signal objects that will be responsible for converting objects to and from JSON bytes.
func NewSerializer ¶
func NewSerializer() *Serializer
NewSerializer will return a new serializer object that will be used to encode/decode Signal objects into bytes.