testutils

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ECDSAGenerator

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

ECDSAGenerator generates ECDSA key pairs.

func (*ECDSAGenerator) Generate

func (g *ECDSAGenerator) Generate() (*KeyPair, error)

Generate generates a new key pair.

type Ed25519Generator

type Ed25519Generator struct{}

Ed25519Generator generates Ed25519 key pairs.

func (*Ed25519Generator) Generate

func (g *Ed25519Generator) Generate() (*KeyPair, error)

Generate generates a new key pair.

type KeyPair

type KeyPair struct {
	PublicKey  []byte
	PrivateKey []byte
}

KeyPair holds the public and private key PEM block bytes.

type KeyPairGenerator

type KeyPairGenerator interface {
	Generate() (*KeyPair, error)
}

KeyPairGenerator generates a new key pair.

func NewECDSAGenerator

func NewECDSAGenerator(c elliptic.Curve) KeyPairGenerator

NewECDSAGenerator returns a new ECDSA key pair generator.

func NewEd25519Generator

func NewEd25519Generator() KeyPairGenerator

NewEd25519Generator returns a new Ed25519 key pair generator.

func NewRSAGenerator

func NewRSAGenerator(bits int) KeyPairGenerator

NewRSAGenerator returns a new RSA key pair generator.

type RSAGenerator

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

RSAGenerator generates RSA key pairs.

func (*RSAGenerator) Generate

func (g *RSAGenerator) Generate() (*KeyPair, error)

Generate generates a new key pair.

type RetryI added in v0.3.0

type RetryI interface {
	IsRetryable(err error, opDesc string) bool
	SetTimeout(timeout time.Duration)
	SetInterval(interval time.Duration)
	SetBackoff(backoff time.Duration)
	SetRetries(retries int)
	Timeout() time.Duration
	Interval() time.Duration
	Backoff() time.Duration
	Retries() int
	Counter() int
}

RetryI is an interface for retry operations

func NewRetry added in v0.3.0

func NewRetry() RetryI

NewRetry returns a new retry operation

type RetryOp added in v0.3.0

type RetryOp struct {
	RetryI
	// contains filtered or unexported fields
}

RetryOp is a retry operation

func (RetryOp) Backoff added in v0.3.0

func (r RetryOp) Backoff() time.Duration

Backoff returns the backoff for the retry operation

func (RetryOp) Counter added in v0.9.0

func (r RetryOp) Counter() int

Counter returns the number of times the operation has been retried

func (RetryOp) Interval added in v0.3.0

func (r RetryOp) Interval() time.Duration

Interval returns the interval for the retry operation

func (RetryOp) IsRetryable added in v0.4.0

func (r RetryOp) IsRetryable(err error, opDesc string) bool

IsRetryable returns true if the operation is retryable

func (RetryOp) Retries added in v0.3.0

func (r RetryOp) Retries() int

Retries returns the number of retries for the retry operation

func (RetryOp) SetBackoff added in v0.3.0

func (r RetryOp) SetBackoff(backoff time.Duration)

SetBackoff sets the backoff for the retry operation

func (RetryOp) SetInterval added in v0.3.0

func (r RetryOp) SetInterval(interval time.Duration)

SetInterval sets the interval for the retry operation

func (RetryOp) SetRetries added in v0.3.0

func (r RetryOp) SetRetries(retries int)

SetRetries sets the number of retries for the retry operation

func (RetryOp) SetTimeout added in v0.3.0

func (r RetryOp) SetTimeout(timeout time.Duration)

SetTimeout sets the timeout for the retry operation

func (RetryOp) Timeout added in v0.3.0

func (r RetryOp) Timeout() time.Duration

Timeout returns the timeout for the retry operation

Jump to

Keyboard shortcuts

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