Documentation ¶
Overview ¶
Package regserver provides a mock registry server for testing purposes
Index ¶
- func NewMemRegistry(rem *remote.Remote) registry.Registry
- func NewMockServer() (*regclient.Client, *httptest.Server)
- func NewMockServerRegistry(reg registry.Registry) (*regclient.Client, *httptest.Server)
- func NewTempRegistry(ctx context.Context, peername, tmpDirPrefix string, g gen.CryptoGenerator) (*registry.Registry, func(), error)
- type MockRepoSearch
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMemRegistry ¶
NewMemRegistry creates a new in-memory registry
func NewMockServer ¶
NewMockServer creates an in-memory mock server & matching registry client
func NewMockServerRegistry ¶
NewMockServerRegistry creates a mock server & client with a passed-in registry
func NewTempRegistry ¶
func NewTempRegistry(ctx context.Context, peername, tmpDirPrefix string, g gen.CryptoGenerator) (*registry.Registry, func(), error)
NewTempRegistry creates a functioning registry with a teardown function TODO(b5) - the tempRepo.Repo call in this func *requires* the passed-in context be cancelled at some point. drop the cleanup function return in favour of listening for ctx.Done and running the cleanup routine internally
Types ¶
type MockRepoSearch ¶
MockRepoSearch proxies search to base.ListDatasets' "term" argument for simple-but-real search
func (MockRepoSearch) Search ¶
func (ss MockRepoSearch) Search(p registry.SearchParams) ([]*dataset.Dataset, error)
Search implements the registry.Searchable interface