regserver

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2021 License: GPL-3.0 Imports: 14 Imported by: 1

Documentation

Overview

Package regserver provides a mock registry server for testing purposes

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMemRegistry

func NewMemRegistry(rem *remote.Remote) registry.Registry

NewMemRegistry creates a new in-memory registry

func NewMockServer

func NewMockServer() (*regclient.Client, *httptest.Server)

NewMockServer creates an in-memory mock server & matching registry client

func NewMockServerRegistry

func NewMockServerRegistry(reg registry.Registry) (*regclient.Client, *httptest.Server)

NewMockServerRegistry creates a mock server & client with a passed-in registry

func NewTempRegistry

func NewTempRegistry(ctx context.Context, peername, tmpDirPrefix string, g key.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

type MockRepoSearch struct {
	repo.Repo
}

MockRepoSearch proxies search to base.ListDatasets' "term" argument for simple-but-real search

func (MockRepoSearch) Search

Search implements the registry.Searchable interface

Directories

Path Synopsis
Package handlers creates HTTP handler functions for registry interface implementations
Package handlers creates HTTP handler functions for registry interface implementations

Jump to

Keyboard shortcuts

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