mocks

package
v0.20251216.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: MPL-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMockExporterImpl

func NewMockExporterImpl(salesforceClient email.SalesforceClient) emailpb.ExporterClient

NewMockExporterImpl returns a MockExporterClientImpl as an ExporterClient.

Types

type MockCA

type MockCA struct {
	PEM []byte
}

MockCA is a mock of a CA that always returns the cert from PEM in response to IssueCertificate.

func (*MockCA) IssueCertificate

IssueCertificate is a mock

type MockCRLGenerator

type MockCRLGenerator struct{}

func (*MockCRLGenerator) GenerateCRL

GenerateCRL is a mock

type MockExporterClientImpl

type MockExporterClientImpl struct {
	SalesforceClient email.SalesforceClient
}

MockExporterClientImpl is a mock implementation of ExporterClient.

func (*MockExporterClientImpl) SendCase added in v0.20251103.0

SendCase submits a Case using the inner email.SalesforceClient.

func (*MockExporterClientImpl) SendContacts

SendContacts submits emails to the inner email.SalesforceClient, returning an error if any fail.

type MockSalesforceClientImpl added in v0.20251103.0

type MockSalesforceClientImpl struct {
	sync.Mutex
	CreatedContacts []string
	CreatedCases    []email.Case
}

MockSalesforceClientImpl is a mock implementation of email.SalesforceClient.

func NewMockSalesforceClientImpl added in v0.20251103.0

func NewMockSalesforceClientImpl() *MockSalesforceClientImpl

NewMockSalesforceClientImpl returns a MockSalesforceClientImpl, which implements the PardotClient interface. It returns the underlying concrete type, so callers have access to its struct members and helper methods.

func (*MockSalesforceClientImpl) GetCreatedCases added in v0.20251103.0

func (m *MockSalesforceClientImpl) GetCreatedCases() []email.Case

GetCreatedCases is used for testing to retrieve the list of created cases in a thread-safe manner.

func (*MockSalesforceClientImpl) GetCreatedContacts added in v0.20251103.0

func (m *MockSalesforceClientImpl) GetCreatedContacts() []string

GetCreatedContacts is used for testing to retrieve the list of created contacts in a thread-safe manner.

func (*MockSalesforceClientImpl) SendCase added in v0.20251103.0

func (m *MockSalesforceClientImpl) SendCase(payload email.Case) error

SendCase adds a case payload to CreatedCases.

func (*MockSalesforceClientImpl) SendContact added in v0.20251103.0

func (m *MockSalesforceClientImpl) SendContact(email string) error

SendContact adds an email to CreatedContacts.

type PublisherClient

type PublisherClient struct {
}

PublisherClient is a mock

func (*PublisherClient) SubmitToSingleCTWithResult

func (*PublisherClient) SubmitToSingleCTWithResult(_ context.Context, _ *pubpb.Request, _ ...grpc.CallOption) (*pubpb.Result, error)

SubmitToSingleCTWithResult is a mock

type ServerStreamClient

type ServerStreamClient[T any] struct {
	grpc.ClientStream
	Results []*T
	Err     error
}

ServerStreamClient is a mock which satisfies the grpc.ClientStream interface, allowing it to be returned by methods where the server returns a stream of results. It can be populated with a list of results to return, or an error to return.

func (*ServerStreamClient[T]) Recv

func (c *ServerStreamClient[T]) Recv() (*T, error)

Recv returns the error, if populated. Otherwise it returns the next item from the list of results. If it has returned all items already, it returns EOF.

type StorageAuthorityReadOnly

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

StorageAuthorityReadOnly is a mock of sapb.StorageAuthorityReadOnlyClient

func NewStorageAuthorityReadOnly

func NewStorageAuthorityReadOnly(clk clock.Clock) *StorageAuthorityReadOnly

NewStorageAuthorityReadOnly creates a new mock read-only storage authority with the given clock.

func (*StorageAuthorityReadOnly) CheckIdentifiersPaused

func (sa *StorageAuthorityReadOnly) CheckIdentifiersPaused(_ context.Context, _ *sapb.PauseRequest, _ ...grpc.CallOption) (*sapb.Identifiers, error)

CheckIdentifiersPaused is a mock

func (*StorageAuthorityReadOnly) CountInvalidAuthorizations2

func (sa *StorageAuthorityReadOnly) CountInvalidAuthorizations2(ctx context.Context, req *sapb.CountInvalidAuthorizationsRequest, _ ...grpc.CallOption) (*sapb.Count, error)

func (*StorageAuthorityReadOnly) CountPendingAuthorizations2

func (sa *StorageAuthorityReadOnly) CountPendingAuthorizations2(ctx context.Context, req *sapb.RegistrationID, _ ...grpc.CallOption) (*sapb.Count, error)

func (*StorageAuthorityReadOnly) FQDNSetExists

FQDNSetExists is a mock

func (*StorageAuthorityReadOnly) FQDNSetTimestampsForWindow

func (sa *StorageAuthorityReadOnly) FQDNSetTimestampsForWindow(_ context.Context, _ *sapb.CountFQDNSetsRequest, _ ...grpc.CallOption) (*sapb.Timestamps, error)

FQDNSetTimestampsForWindow is a mock

func (*StorageAuthorityReadOnly) GetAuthorization2

GetAuthorization2 is a mock

func (*StorageAuthorityReadOnly) GetCertificate

func (sa *StorageAuthorityReadOnly) GetCertificate(_ context.Context, req *sapb.Serial, _ ...grpc.CallOption) (*corepb.Certificate, error)

GetCertificate is a mock

func (*StorageAuthorityReadOnly) GetCertificateStatus

func (sa *StorageAuthorityReadOnly) GetCertificateStatus(_ context.Context, req *sapb.Serial, _ ...grpc.CallOption) (*corepb.CertificateStatus, error)

GetCertificateStatus is a mock

func (*StorageAuthorityReadOnly) GetEnabledRateLimitOverrides

GetEnabledRateLimitOverrides is a mock

func (*StorageAuthorityReadOnly) GetLintPrecertificate

func (sa *StorageAuthorityReadOnly) GetLintPrecertificate(_ context.Context, req *sapb.Serial, _ ...grpc.CallOption) (*corepb.Certificate, error)

GetLintPrecertificate is a mock

func (*StorageAuthorityReadOnly) GetOrder

GetOrder is a mock

func (*StorageAuthorityReadOnly) GetOrderForNames

func (*StorageAuthorityReadOnly) GetPausedIdentifiers

func (sa *StorageAuthorityReadOnly) GetPausedIdentifiers(_ context.Context, _ *sapb.RegistrationID, _ ...grpc.CallOption) (*sapb.Identifiers, error)

GetPausedIdentifiers is a mock

func (*StorageAuthorityReadOnly) GetRateLimitOverride

GetRateLimitOverride is a mock

func (*StorageAuthorityReadOnly) GetRegistration

GetRegistration is a mock

func (*StorageAuthorityReadOnly) GetRegistrationByKey

func (sa *StorageAuthorityReadOnly) GetRegistrationByKey(_ context.Context, req *sapb.JSONWebKey, _ ...grpc.CallOption) (*corepb.Registration, error)

GetRegistrationByKey is a mock

func (*StorageAuthorityReadOnly) GetRevocationStatus

func (sa *StorageAuthorityReadOnly) GetRevocationStatus(_ context.Context, req *sapb.Serial, _ ...grpc.CallOption) (*sapb.RevocationStatus, error)

GetRevocationStatus is a mock

func (*StorageAuthorityReadOnly) GetRevokedCertsByShard

GetRevokedCertsByShard is a mock

func (*StorageAuthorityReadOnly) GetSerialMetadata

func (sa *StorageAuthorityReadOnly) GetSerialMetadata(ctx context.Context, req *sapb.Serial, _ ...grpc.CallOption) (*sapb.SerialMetadata, error)

GetSerialMetadata is a mock

func (*StorageAuthorityReadOnly) GetSerialsByAccount

GetSerialsByAccount is a mock

func (*StorageAuthorityReadOnly) GetSerialsByKey

GetSerialsByKey is a mock

func (*StorageAuthorityReadOnly) GetValidAuthorizations2

func (*StorageAuthorityReadOnly) GetValidOrderAuthorizations2

func (*StorageAuthorityReadOnly) IncidentsForSerial

func (sa *StorageAuthorityReadOnly) IncidentsForSerial(ctx context.Context, req *sapb.Serial, _ ...grpc.CallOption) (*sapb.Incidents, error)

IncidentsForSerial is a mock.

func (*StorageAuthorityReadOnly) KeyBlocked

func (sa *StorageAuthorityReadOnly) KeyBlocked(ctx context.Context, req *sapb.SPKIHash, _ ...grpc.CallOption) (*sapb.Exists, error)

KeyBlocked is a mock

func (*StorageAuthorityReadOnly) ReplacementOrderExists

func (sa *StorageAuthorityReadOnly) ReplacementOrderExists(ctx context.Context, req *sapb.Serial, _ ...grpc.CallOption) (*sapb.Exists, error)

ReplacementOrderExists is a mock.

func (*StorageAuthorityReadOnly) SerialsForIncident

SerialsForIncident is a mock

Jump to

Keyboard shortcuts

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