Documentation
¶
Overview ¶
storage defines a storage mechanism
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCorrelationIdNotFound = errors.New("could not get correlation-id from cache")
Functions ¶
This section is empty.
Types ¶
type CacheMetrics ¶
type CorrelationData ¶
type CorrelationData struct {
sync.Mutex
// data contains data for a correlation-id in AES encrypted json format.
Data []string `json:"data"`
// secretkey is a secret key for original user verification
SecretKey string `json:"-"`
// AESKey is the AES encryption key in encrypted format.
AESKeyEncrypted string `json:"aes-key"`
// decrypted AES key for signing
AESKey []byte `json:"-"`
}
CorrelationData is the data for a correlation-id.
type GetInteractionsFunc ¶
type GetInteractionsFunc func() []string
type Storage ¶
type Storage interface {
GetCacheMetrics() (*CacheMetrics, error)
SetIDPublicKey(correlationID, secretKey, publicKey string) error
SetID(ID string) error
AddInteraction(correlationID string, data []byte) error
AddInteractionWithId(id string, data []byte) error
GetInteractions(correlationID, secret string) ([]string, string, error)
GetInteractionsWithId(id string) ([]string, error)
RemoveID(correlationID, secret string) error
GetCacheItem(token string) (*CorrelationData, error)
Close() error
}
Click to show internal directories.
Click to hide internal directories.