mysql

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MySQLTransitKeyRepository

type MySQLTransitKeyRepository struct {
	// contains filtered or unexported fields
}

MySQLTransitKeyRepository implements transit key persistence for MySQL databases.

func NewMySQLTransitKeyRepository

func NewMySQLTransitKeyRepository(db *sql.DB) *MySQLTransitKeyRepository

NewMySQLTransitKeyRepository creates a new MySQL transit key repository instance.

func (*MySQLTransitKeyRepository) Create

Create inserts a new transit key into the MySQL database.

func (*MySQLTransitKeyRepository) Delete

func (m *MySQLTransitKeyRepository) Delete(ctx context.Context, name string) error

Delete soft-deletes all versions of a transit key by name.

func (*MySQLTransitKeyRepository) GetByName

GetByName retrieves the latest non-deleted version of a transit key by name.

func (*MySQLTransitKeyRepository) GetByNameAndVersion

func (m *MySQLTransitKeyRepository) GetByNameAndVersion(
	ctx context.Context,
	name string,
	version uint,
) (*transitDomain.TransitKey, error)

GetByNameAndVersion retrieves a specific version of a transit key by name and version.

func (*MySQLTransitKeyRepository) GetTransitKey added in v0.28.0

GetTransitKey retrieves a transit key version by name and optional version (0 for latest), including its associated encryption algorithm. Returns ErrTransitKeyNotFound if not found.

func (*MySQLTransitKeyRepository) HardDelete added in v0.26.0

func (m *MySQLTransitKeyRepository) HardDelete(
	ctx context.Context,
	olderThan time.Time,
	dryRun bool,
) (int64, error)

HardDelete permanently removes soft-deleted transit keys older than the specified time.

func (*MySQLTransitKeyRepository) ListCursor added in v0.25.0

func (m *MySQLTransitKeyRepository) ListCursor(
	ctx context.Context,
	afterName *string,
	limit int,
) ([]*transitDomain.TransitKey, error)

ListCursor retrieves transit keys ordered by name ascending using cursor-based pagination. Returns the latest version for each key.

Jump to

Keyboard shortcuts

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