testsupport

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileMock

type FileMock struct {
	Name     string
	Contents string
}

type HubMockServer

type HubMockServer struct {
	Server        *httptest.Server
	Handler       http.Handler
	StorageServer *StorageMockServer
}

func NewHubMockServer

func NewHubMockServer(storageServer *StorageMockServer) *HubMockServer

func (*HubMockServer) Close

func (m *HubMockServer) Close()

func (*HubMockServer) Host

func (m *HubMockServer) Host() string

func (*HubMockServer) Init

func (m *HubMockServer) Init()

func (*HubMockServer) URL

func (m *HubMockServer) URL() string

type StorageMockServer

type StorageMockServer struct {
	Server           *httptest.Server
	Handler          http.Handler
	StorageDirectory string
	MaxFailures      int
	RequestCount     int
}

func NewStorageMockServer

func NewStorageMockServer() (*StorageMockServer, error)

func (*StorageMockServer) Close

func (m *StorageMockServer) Close()

func (*StorageMockServer) Host

func (m *StorageMockServer) Host() string

func (*StorageMockServer) Init

func (m *StorageMockServer) Init(files []FileMock) error

func (*StorageMockServer) IsDir

func (m *StorageMockServer) IsDir(path string) bool

func (*StorageMockServer) IsFile

func (m *StorageMockServer) IsFile(fileName string) bool

func (*StorageMockServer) PullURLs

func (m *StorageMockServer) PullURLs(paths []string) ([]*api.SignedURL, error)

func (*StorageMockServer) PushURLs

func (m *StorageMockServer) PushURLs(paths []string, force bool) ([]*api.SignedURL, error)

func (*StorageMockServer) SetMaxFailures added in v0.6.2

func (m *StorageMockServer) SetMaxFailures(maxFailures int)

func (*StorageMockServer) URL

func (m *StorageMockServer) URL() string

func (*StorageMockServer) YankURLs

func (m *StorageMockServer) YankURLs(paths []string) ([]*api.SignedURL, error)

Jump to

Keyboard shortcuts

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