store

package
v2.16.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommonNameKey     = "commonName"     // must match with pb.SigningRecord.CommonName tag
	OwnerKey          = "owner"          // must match with pb.SigningRecord.Owner tag
	DateKey           = "date"           // must match with pb.SigningRecord.Date tag
	CredentialKey     = "credential"     // must match with pb.SigningRecord.Credential tag
	CreationDateKey   = "creationDate"   // must match with pb.SigningRecord.CreationDate tag
	PublicKeyKey      = "publicKey"      // must match with pb.SigningRecord.PublicKey tag
	ValidUntilDateKey = "validUntilDate" // must match with pb.SigningRecord.Credential.ValidUntilDate tag
	DeviceIDKey       = "deviceId"       // must match with pb.SigningRecord.Credential.DeviceID tag
)

Variables

View Source
var ErrNotSupported = errors.New("not supported")

Functions

This section is empty.

Types

type DeleteSigningRecordsQuery

type DeleteSigningRecordsQuery = pb.DeleteSigningRecordsRequest

type LoadSigningRecordsFunc

type LoadSigningRecordsFunc = func(ctx context.Context, iter SigningRecordIter) (err error)

type SigningRecord

type SigningRecord = pb.SigningRecord

type SigningRecordIter

type SigningRecordIter interface {
	Next(ctx context.Context, SigningRecord *SigningRecord) bool
	Err() error
}

type SigningRecordsQuery

type SigningRecordsQuery = pb.GetSigningRecordsRequest

type Store

type Store interface {
	// CreateSigningRecord creates a new signing record. If the record already exists, it will throw an error.
	CreateSigningRecord(ctx context.Context, record *SigningRecord) error
	// UpdateSigningRecord updates an existing signing record. If the record does not exist, it will create a new one.
	UpdateSigningRecord(ctx context.Context, record *SigningRecord) error
	DeleteSigningRecords(ctx context.Context, ownerID string, query *DeleteSigningRecordsQuery) (int64, error)
	LoadSigningRecords(ctx context.Context, ownerID string, query *SigningRecordsQuery, h LoadSigningRecordsFunc) error

	// DeleteNonDeviceExpiredRecords deletes all expired records that are not associated with a device.
	// For CqlDB, this is a no-op because expired records are deleted by Cassandra automatically.
	DeleteNonDeviceExpiredRecords(ctx context.Context, now time.Time) (int64, error)

	Close(ctx context.Context) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL