Documentation ¶
Index ¶
- type MockContentStore
- func (*MockContentStore) Abort(ctx context.Context, ref string) error
- func (*MockContentStore) Delete(ctx context.Context, dgst digest.Digest) error
- func (m *MockContentStore) Info(ctx context.Context, dgst digest.Digest) (content.Info, error)
- func (*MockContentStore) ListStatuses(ctx context.Context, filters ...string) ([]content.Status, error)
- func (m *MockContentStore) ReaderAt(ctx context.Context, desc v1.Descriptor) (content.ReaderAt, error)
- func (*MockContentStore) Status(ctx context.Context, ref string) (content.Status, error)
- func (*MockContentStore) Update(ctx context.Context, info content.Info, fieldpaths ...string) (content.Info, error)
- func (*MockContentStore) Walk(ctx context.Context, fn content.WalkFunc, filters ...string) error
- func (*MockContentStore) Writer(ctx context.Context, opts ...content.WriterOpt) (content.Writer, error)
- type MockEventService
- func (*MockEventService) Forward(ctx context.Context, envelope *events.Envelope) error
- func (*MockEventService) Publish(ctx context.Context, topic string, event events.Event) error
- func (m *MockEventService) Subscribe(ctx context.Context, filters ...string) (ch <-chan *events.Envelope, errs <-chan error)
- type MockHost
- func (*MockHost) Addrs() []multiaddr.Multiaddr
- func (*MockHost) Close() error
- func (*MockHost) ConnManager() connmgr.ConnManager
- func (*MockHost) Connect(ctx context.Context, pi peer.AddrInfo) error
- func (*MockHost) EventBus() event.Bus
- func (*MockHost) ID() peer.ID
- func (*MockHost) Mux() protocol.Switch
- func (*MockHost) Network() network.Network
- func (*MockHost) NewStream(ctx context.Context, p peer.ID, pids ...protocol.ID) (network.Stream, error)
- func (m *MockHost) Peerstore() peerstore.Peerstore
- func (*MockHost) RemoveStreamHandler(pid protocol.ID)
- func (*MockHost) SetStreamHandler(pid protocol.ID, handler network.StreamHandler)
- func (*MockHost) SetStreamHandlerMatch(protocol.ID, func(protocol.ID) bool, network.StreamHandler)
- type MockImageStore
- func (*MockImageStore) Create(ctx context.Context, image images.Image) (images.Image, error)
- func (*MockImageStore) Delete(ctx context.Context, name string, opts ...images.DeleteOpt) error
- func (m *MockImageStore) Get(ctx context.Context, name string) (images.Image, error)
- func (m *MockImageStore) List(ctx context.Context, filters ...string) ([]images.Image, error)
- func (*MockImageStore) Update(ctx context.Context, image images.Image, fieldpaths ...string) (images.Image, error)
- type MockPeerstore
- func (*MockPeerstore) AddAddr(p peer.ID, addr multiaddr.Multiaddr, ttl time.Duration)
- func (*MockPeerstore) AddAddrs(p peer.ID, addrs []multiaddr.Multiaddr, ttl time.Duration)
- func (*MockPeerstore) AddPrivKey(peer.ID, crypto.PrivKey) error
- func (*MockPeerstore) AddProtocols(peer.ID, ...protocol.ID) error
- func (*MockPeerstore) AddPubKey(peer.ID, crypto.PubKey) error
- func (*MockPeerstore) AddrStream(context.Context, peer.ID) <-chan multiaddr.Multiaddr
- func (*MockPeerstore) Addrs(p peer.ID) []multiaddr.Multiaddr
- func (*MockPeerstore) ClearAddrs(p peer.ID)
- func (*MockPeerstore) Close() error
- func (*MockPeerstore) FirstSupportedProtocol(peer.ID, ...protocol.ID) (protocol.ID, error)
- func (*MockPeerstore) Get(p peer.ID, key string) (interface{}, error)
- func (*MockPeerstore) GetProtocols(peer.ID) ([]protocol.ID, error)
- func (*MockPeerstore) LatencyEWMA(peer.ID) time.Duration
- func (*MockPeerstore) PeerInfo(peer.ID) peer.AddrInfo
- func (*MockPeerstore) Peers() peer.IDSlice
- func (*MockPeerstore) PeersWithAddrs() peer.IDSlice
- func (*MockPeerstore) PeersWithKeys() peer.IDSlice
- func (*MockPeerstore) PrivKey(peer.ID) crypto.PrivKey
- func (*MockPeerstore) PubKey(peer.ID) crypto.PubKey
- func (*MockPeerstore) Put(p peer.ID, key string, val interface{}) error
- func (*MockPeerstore) RecordLatency(peer.ID, time.Duration)
- func (*MockPeerstore) RemovePeer(peer.ID)
- func (*MockPeerstore) RemoveProtocols(peer.ID, ...protocol.ID) error
- func (*MockPeerstore) SetAddr(p peer.ID, addr multiaddr.Multiaddr, ttl time.Duration)
- func (*MockPeerstore) SetAddrs(p peer.ID, addrs []multiaddr.Multiaddr, ttl time.Duration)
- func (*MockPeerstore) SetProtocols(peer.ID, ...protocol.ID) error
- func (*MockPeerstore) SupportsProtocols(peer.ID, ...protocol.ID) ([]protocol.ID, error)
- func (*MockPeerstore) UpdateAddrs(p peer.ID, oldTTL time.Duration, newTTL time.Duration)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockContentStore ¶
MockContentStore is a mock implementation of containerd's content store.
func (*MockContentStore) Abort ¶
func (*MockContentStore) Abort(ctx context.Context, ref string) error
func (*MockContentStore) Delete ¶
func (*MockContentStore) Delete(ctx context.Context, dgst digest.Digest) error
func (*MockContentStore) Info ¶
Info returns the content.Info for the given digest, if it exists in the mocked data keyed by digest.
func (*MockContentStore) ListStatuses ¶
func (*MockContentStore) ReaderAt ¶
func (m *MockContentStore) ReaderAt(ctx context.Context, desc v1.Descriptor) (content.ReaderAt, error)
ReaderAt returns a content.ReaderAt for the given descriptor, if it exists in the mocked data keyed by digest.
type MockEventService ¶
type MockHost ¶
MockHost provides a mock implementation of host.Host for unit testing.
func (*MockHost) ConnManager ¶
func (*MockHost) ConnManager() connmgr.ConnManager
func (*MockHost) RemoveStreamHandler ¶
func (*MockHost) SetStreamHandler ¶
func (*MockHost) SetStreamHandler(pid protocol.ID, handler network.StreamHandler)
func (*MockHost) SetStreamHandlerMatch ¶
type MockImageStore ¶
MockImageStore is a mock implementation of containerd's image store.
func (*MockImageStore) Get ¶
Get gets an image by name if it exists in the mocked data keyed by name.
type MockPeerstore ¶
type MockPeerstore struct{}
MockPeerstore provides a mock implementation of peerstore.Peerstore for unit testing.
func (*MockPeerstore) AddPrivKey ¶
func (*MockPeerstore) AddProtocols ¶
func (*MockPeerstore) AddrStream ¶
func (*MockPeerstore) ClearAddrs ¶
func (*MockPeerstore) ClearAddrs(p peer.ID)
func (*MockPeerstore) Close ¶
func (*MockPeerstore) Close() error
func (*MockPeerstore) FirstSupportedProtocol ¶
func (*MockPeerstore) GetProtocols ¶
func (*MockPeerstore) LatencyEWMA ¶
func (*MockPeerstore) LatencyEWMA(peer.ID) time.Duration
func (*MockPeerstore) Peers ¶
func (*MockPeerstore) Peers() peer.IDSlice
func (*MockPeerstore) PeersWithAddrs ¶
func (*MockPeerstore) PeersWithAddrs() peer.IDSlice
func (*MockPeerstore) PeersWithKeys ¶
func (*MockPeerstore) PeersWithKeys() peer.IDSlice
func (*MockPeerstore) PrivKey ¶
func (*MockPeerstore) PrivKey(peer.ID) crypto.PrivKey
PrivKey generates a new private key for the given peer.
func (*MockPeerstore) RecordLatency ¶
func (*MockPeerstore) RecordLatency(peer.ID, time.Duration)
func (*MockPeerstore) RemovePeer ¶
func (*MockPeerstore) RemovePeer(peer.ID)