level2

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
	Backend drkey.Level2DB
	Metrics *Metrics
}

func (*Database) Close

func (db *Database) Close() error

func (*Database) DeleteExpiredASHostKeys

func (db *Database) DeleteExpiredASHostKeys(
	ctx context.Context,
	cutoff time.Time) (int, error)

func (*Database) DeleteExpiredHostASKeys

func (db *Database) DeleteExpiredHostASKeys(
	ctx context.Context,
	cutoff time.Time) (int, error)

func (*Database) DeleteExpiredHostHostKeys

func (db *Database) DeleteExpiredHostHostKeys(
	ctx context.Context,
	cutoff time.Time) (int, error)

func (*Database) GetASHostKey

func (db *Database) GetASHostKey(
	ctx context.Context,
	meta drkey.ASHostMeta) (drkey.ASHostKey, error)

func (*Database) GetHostASKey

func (db *Database) GetHostASKey(
	ctx context.Context,
	meta drkey.HostASMeta) (drkey.HostASKey, error)

func (*Database) GetHostHostKey

func (db *Database) GetHostHostKey(
	ctx context.Context,
	meta drkey.HostHostMeta) (drkey.HostHostKey, error)

func (*Database) InsertASHostKey

func (db *Database) InsertASHostKey(ctx context.Context, key drkey.ASHostKey) error

func (*Database) InsertHostASKey

func (db *Database) InsertHostASKey(ctx context.Context, key drkey.HostASKey) error

func (*Database) InsertHostHostKey

func (db *Database) InsertHostHostKey(ctx context.Context, key drkey.HostHostKey) error

func (*Database) SetMaxIdleConns

func (db *Database) SetMaxIdleConns(maxIdleConns int)

func (*Database) SetMaxOpenConns

func (db *Database) SetMaxOpenConns(maxOpenConns int)

type Metrics

type Metrics struct {
	QueriesTotal func(op, result string) metrics.Counter
}

func (*Metrics) Observe

func (m *Metrics) Observe(
	ctx context.Context,
	op string,
	action func(context.Context) error,
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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