* feat(sessionresolver): try many and use what works * fix(sessionresolver): make sure we can use quic * fix: the config struct is unnecessary * fix: make kvstore optional * feat: write simple integration test * feat: start adding tests * feat: continue writing tests * fix(sessionresolver): add more unit tests * fix(sessionresolver): finish adding tests * refactor(sessionresolver): changes after code review
33 lines
825 B
Go
33 lines
825 B
Go
package sessionresolver
|
|
|
|
// KVStore is a generic key-value store. We use it to store
|
|
// on disk persistent state used by this package.
|
|
type KVStore interface {
|
|
// Get gets the value for the given key.
|
|
Get(key string) ([]byte, error)
|
|
|
|
// Set sets the value of the given key.
|
|
Set(key string, value []byte) error
|
|
}
|
|
|
|
// Logger defines the common logger interface.
|
|
type Logger interface {
|
|
// Debug emits a debug message.
|
|
Debug(msg string)
|
|
|
|
// Debugf formats and emits a debug message.
|
|
Debugf(format string, v ...interface{})
|
|
|
|
// Info emits an informational message.
|
|
Info(msg string)
|
|
|
|
// Infof format and emits an informational message.
|
|
Infof(format string, v ...interface{})
|
|
|
|
// Warn emits a warning message.
|
|
Warn(msg string)
|
|
|
|
// Warnf formats and emits a warning message.
|
|
Warnf(format string, v ...interface{})
|
|
}
|