{"modulePath":"github.com/bitechdev/ResolveSpec","version":"v1.2.5","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package testing\n\n## Types\n\n```go\ntype MockCachePolicy struct {\n\tCacheTime int\n\tHeaders   map[string]string\n}\n```\nMockCachePolicy is a configurable cache policy for testing.\n\n```go\nfunc NewMockCachePolicy(cacheTime int) *MockCachePolicy\n```\nNewMockCachePolicy creates a new mock cache policy.\n\n```go\nfunc (p *MockCachePolicy) GetCacheHeaders(path string) map[string]string\n```\nGetCacheHeaders returns the configured headers.\n\n```go\nfunc (p *MockCachePolicy) GetCacheTime(path string) int\n```\nGetCacheTime returns the configured cache time.\n\n```go\ntype MockFallbackStrategy struct {\n\tShouldFallbackFunc func(path string) bool\n\tFallbackPathFunc   func(path string) string\n}\n```\nMockFallbackStrategy is a configurable fallback strategy for testing.\n\n```go\nfunc NewMockFallbackStrategy(shouldFallback func(string) bool, fallbackPath func(string) string) *MockFallbackStrategy\n```\nNewMockFallbackStrategy creates a new mock fallback strategy.\n\n```go\nfunc (s *MockFallbackStrategy) GetFallbackPath(path string) string\n```\nGetFallbackPath returns the fallback path.\n\n```go\nfunc (s *MockFallbackStrategy) ShouldFallback(path string) bool\n```\nShouldFallback returns whether fallback should be used.\n\n```go\ntype MockFileSystemProvider struct {\n\t// contains filtered or unexported fields\n}\n```\nMockFileSystemProvider is an in-memory filesystem provider for testing.\n\n```go\nfunc NewMockProvider(files map[string][]byte) *MockFileSystemProvider\n```\nNewMockProvider creates a new in-memory provider with the given files. Keys should be slash-separated paths (e.g., \"index.html\", \"assets/app.js\").\n\n```go\nfunc (m *MockFileSystemProvider) AddFile(name string, data []byte)\n```\nAddFile adds a file to the in-memory filesystem.\n\n```go\nfunc (m *MockFileSystemProvider) Close() error\n```\nClose marks the provider as closed.\n\n```go\nfunc (m *MockFileSystemProvider) Open(name string) (fs.File, error)\n```\nOpen opens a file from the in-memory filesystem.\n\n```go\nfunc (m *MockFileSystemProvider) RemoveFile(name string)\n```\nRemoveFile removes a file from the in-memory filesystem.\n\n```go\nfunc (m *MockFileSystemProvider) Type() string\n```\nType returns \"mock\".\n\n```go\ntype MockMIMEResolver struct {\n\t// contains filtered or unexported fields\n}\n```\nMockMIMEResolver is a configurable MIME resolver for testing.\n\n```go\nfunc NewMockMIMEResolver() *MockMIMEResolver\n```\nNewMockMIMEResolver creates a new mock MIME resolver.\n\n```go\nfunc (r *MockMIMEResolver) GetMIMEType(path string) string\n```\nGetMIMEType returns the MIME type for the given path.\n\n```go\nfunc (r *MockMIMEResolver) RegisterMIMEType(extension, mimeType string)\n```\nRegisterMIMEType registers a MIME type.\n\n","path":"github.com/bitechdev/ResolveSpec/pkg/server/staticweb/testing","name":"testing","synopsis":"","isRedistributable":true}
