Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockCachePolicy ¶
MockCachePolicy is a configurable cache policy for testing.
func NewMockCachePolicy ¶
func NewMockCachePolicy(cacheTime int) *MockCachePolicy
NewMockCachePolicy creates a new mock cache policy.
func (*MockCachePolicy) GetCacheHeaders ¶
func (p *MockCachePolicy) GetCacheHeaders(path string) map[string]string
GetCacheHeaders returns the configured headers.
func (*MockCachePolicy) GetCacheTime ¶
func (p *MockCachePolicy) GetCacheTime(path string) int
GetCacheTime returns the configured cache time.
type MockFallbackStrategy ¶
type MockFallbackStrategy struct {
ShouldFallbackFunc func(path string) bool
FallbackPathFunc func(path string) string
}
MockFallbackStrategy is a configurable fallback strategy for testing.
func NewMockFallbackStrategy ¶
func NewMockFallbackStrategy(shouldFallback func(string) bool, fallbackPath func(string) string) *MockFallbackStrategy
NewMockFallbackStrategy creates a new mock fallback strategy.
func (*MockFallbackStrategy) GetFallbackPath ¶
func (s *MockFallbackStrategy) GetFallbackPath(path string) string
GetFallbackPath returns the fallback path.
func (*MockFallbackStrategy) ShouldFallback ¶
func (s *MockFallbackStrategy) ShouldFallback(path string) bool
ShouldFallback returns whether fallback should be used.
type MockFileSystemProvider ¶
type MockFileSystemProvider struct {
// contains filtered or unexported fields
}
MockFileSystemProvider is an in-memory filesystem provider for testing.
func NewMockProvider ¶
func NewMockProvider(files map[string][]byte) *MockFileSystemProvider
NewMockProvider creates a new in-memory provider with the given files. Keys should be slash-separated paths (e.g., "index.html", "assets/app.js").
func (*MockFileSystemProvider) AddFile ¶
func (m *MockFileSystemProvider) AddFile(name string, data []byte)
AddFile adds a file to the in-memory filesystem.
func (*MockFileSystemProvider) Close ¶
func (m *MockFileSystemProvider) Close() error
Close marks the provider as closed.
func (*MockFileSystemProvider) Open ¶
func (m *MockFileSystemProvider) Open(name string) (fs.File, error)
Open opens a file from the in-memory filesystem.
func (*MockFileSystemProvider) RemoveFile ¶
func (m *MockFileSystemProvider) RemoveFile(name string)
RemoveFile removes a file from the in-memory filesystem.
func (*MockFileSystemProvider) Type ¶
func (m *MockFileSystemProvider) Type() string
Type returns "mock".
type MockMIMEResolver ¶
type MockMIMEResolver struct {
// contains filtered or unexported fields
}
MockMIMEResolver is a configurable MIME resolver for testing.
func NewMockMIMEResolver ¶
func NewMockMIMEResolver() *MockMIMEResolver
NewMockMIMEResolver creates a new mock MIME resolver.
func (*MockMIMEResolver) GetMIMEType ¶
func (r *MockMIMEResolver) GetMIMEType(path string) string
GetMIMEType returns the MIME type for the given path.
func (*MockMIMEResolver) RegisterMIMEType ¶
func (r *MockMIMEResolver) RegisterMIMEType(extension, mimeType string)
RegisterMIMEType registers a MIME type.