-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Felipe Zipitria <[email protected]>
- Loading branch information
Showing
13 changed files
with
414 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright 2024 OWASP CRS Project | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package leipzig | ||
|
||
import "github.com/coreruleset/go-ftw/experimental/corpus" | ||
|
||
// File implements the corpus.File interface. | ||
type File struct { | ||
cacheDir string | ||
filePath string | ||
} | ||
|
||
// NewFile returns a new File | ||
func NewFile() corpus.File { | ||
return File{} | ||
} | ||
|
||
// CacheDir is the directory where files are cached | ||
func (f File) CacheDir() string { | ||
return f.cacheDir | ||
} | ||
|
||
// FilePath is the path to the cached file | ||
func (f File) FilePath() string { | ||
return f.filePath | ||
} | ||
|
||
// WithCacheDir sets the cache directory | ||
func (f File) WithCacheDir(cacheDir string) corpus.File { | ||
f.cacheDir = cacheDir | ||
return f | ||
} | ||
|
||
// WithFilePath sets the file path | ||
func (f File) WithFilePath(filePath string) corpus.File { | ||
f.filePath = filePath | ||
return f | ||
} |
Oops, something went wrong.