Documentation
¶
Overview ¶
Package encoder provides implementations for data encoding and continuation token encoding.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base64Encoder ¶
type Base64Encoder struct{}
Base64Encoder adheres to the Encoder interface, utilizing the encoding/base64 encoding strategy for base64 encoding.
func NewBase64Encoder ¶
func NewBase64Encoder() *Base64Encoder
NewBase64Encoder creates a new instance of the Encoder interface that employs the base64 encoding strategy provided by the encoding/base64 package.
type ContinuationTokenSerializer ¶ added in v1.8.0
type ContinuationTokenSerializer interface {
// Serialize serializes the continuation token into a format readable by ReadChanges
Serialize(ulid string, objType string) (token []byte, err error)
// Deserialize deserializes the continuation token into a format readable by ReadChanges
Deserialize(token string) (ulid string, objType string, err error)
}
func NewStringContinuationTokenSerializer ¶ added in v1.8.0
func NewStringContinuationTokenSerializer() ContinuationTokenSerializer
NewStringContinuationTokenSerializer returns a new instance of StringContinuationTokenSerializer. Serializes the continuation token into a string, as ulid & type concatenated by a pipe.
type NoopEncoder ¶ added in v0.1.5
type NoopEncoder struct{}
NoopEncoder is an implementation of the Encoder interface that performs no actual encoding or decoding.
type StringContinuationTokenSerializer ¶ added in v1.8.0
type StringContinuationTokenSerializer struct{}
StringContinuationTokenSerializer is a ContinuationTokenSerializer that serializes the continuation token as a string.
func (*StringContinuationTokenSerializer) Deserialize ¶ added in v1.8.0
func (ts *StringContinuationTokenSerializer) Deserialize(continuationToken string) (ulid string, objType string, err error)
Deserialize deserializes the continuation token from a string, as ulid & type concatenated by a pipe.
type TokenEncoder ¶ added in v0.1.5
type TokenEncoder struct {
// contains filtered or unexported fields
}
TokenEncoder combines an encrypter and an encoder to provide functionality for encoding and decoding tokens.
func NewTokenEncoder ¶ added in v0.1.5
func NewTokenEncoder(encrypter encrypter.Encrypter, encoder Encoder) *TokenEncoder
NewTokenEncoder constructs a TokenEncoder with the provided encrypter and encoder.