mock

package
v2.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Copyright 2025 The Swarm Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockCache

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

MockCache is a minimal implementation of certmagic.Cache for testing.

func NewMockCache

func NewMockCache() *MockCache

func (*MockCache) Stop

func (m *MockCache) Stop()

type MockConfig

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

MockConfig is a minimal implementation of certmagic.Config for testing.

func NewMockConfig

func NewMockConfig() *MockConfig

func (*MockConfig) TLSConfig

func (m *MockConfig) TLSConfig() *tls.Config

type MockFileStorage

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

MockFileStorage is a minimal implementation of certmagic.FileStorage for testing.

func NewMockFileStorage

func NewMockFileStorage(path string) *MockFileStorage

func (*MockFileStorage) Delete

func (m *MockFileStorage) Delete(_ context.Context, _ string) error

func (*MockFileStorage) Exists

func (m *MockFileStorage) Exists(_ context.Context, _ string) (bool, error)

func (*MockFileStorage) List

func (m *MockFileStorage) List(_ context.Context, _ string, _ bool) ([]string, error)

func (*MockFileStorage) Load

func (m *MockFileStorage) Load(_ context.Context, _ string) ([]byte, error)

func (*MockFileStorage) Lock

func (m *MockFileStorage) Lock(_ context.Context, _ string) error

func (*MockFileStorage) Store

func (m *MockFileStorage) Store(_ context.Context, _ string, _ []byte) error

func (*MockFileStorage) Unlock

func (m *MockFileStorage) Unlock(_ context.Context, _ string) error

type MockP2PForgeCertMgr

type MockP2PForgeCertMgr struct {
	ProvideHost func(host.Host) error
	// contains filtered or unexported fields
}

MockP2PForgeCertMgr is a mock implementation of p2pforge.P2PForgeCertMgr.

func NewMockP2PForgeCertMgr

func NewMockP2PForgeCertMgr(onCertLoaded func()) *MockP2PForgeCertMgr

func (*MockP2PForgeCertMgr) AddressFactory

func (m *MockP2PForgeCertMgr) AddressFactory() config.AddrsFactory

func (*MockP2PForgeCertMgr) GetCache

func (m *MockP2PForgeCertMgr) GetCache() *MockCache

func (*MockP2PForgeCertMgr) SetOnCertLoaded

func (m *MockP2PForgeCertMgr) SetOnCertLoaded(cb func())

func (*MockP2PForgeCertMgr) Start

func (m *MockP2PForgeCertMgr) Start() error

func (*MockP2PForgeCertMgr) Stop

func (m *MockP2PForgeCertMgr) Stop()

func (*MockP2PForgeCertMgr) TLSConfig

func (m *MockP2PForgeCertMgr) TLSConfig() *tls.Config

Jump to

Keyboard shortcuts

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