Documentation ¶
Index ¶
- Constants
- Variables
- func CreateLocalCache() error
- func GetLocalDir() (string, error)
- func GetLocalDirPanic() string
- func List(ctx context.Context, opts ...ListOption) error
- func TabString(fields ...string) string
- type Format
- type ListOption
- type ListOptions
- type WordlistMetadata
- func CheckAllCached(in []WordlistMetadata) ([]WordlistMetadata, error)
- func Get(ctx context.Context, names ...string) (ret []WordlistMetadata, err error)
- func GetLocalDirListing() ([]WordlistMetadata, error)
- func GetRemoteWordlists() ([]WordlistMetadata, error)
- func Save(ctx context.Context, nocache bool, names ...string) (ret []WordlistMetadata, err error)
- func (w WordlistMetadata) APIS() (ret proute.APIS, err error)
- func (w *WordlistMetadata) Cache() error
- func (w *WordlistMetadata) IsCached() bool
- func (w WordlistMetadata) LocalFilename() (string, error)
- func (w WordlistMetadata) LocalFilenamePanic() string
- func (w WordlistMetadata) LocalKiteFilename() (string, error)
- func (w WordlistMetadata) Words() ([]string, error)
Constants ¶
const (
RemoteWordlistBase = "https://wordlists.assetnote.io/data/"
)
Variables ¶
var (
ErrInvalidFormat = fmt.Errorf("unknown format")
)
var (
ErrNotFound = fmt.Errorf("wordlist not found")
)
Functions ¶
func CreateLocalCache ¶
func CreateLocalCache() error
func GetLocalDir ¶
func GetLocalDirPanic ¶
func GetLocalDirPanic() string
Types ¶
type ListOption ¶
type ListOption func(o *ListOptions)
func OutputFormat ¶
func OutputFormat(v Format) ListOption
type ListOptions ¶
type ListOptions struct {
Output Format
}
func NewListOptions ¶
func NewListOptions(opts ...ListOption) *ListOptions
type WordlistMetadata ¶
type WordlistMetadata struct { Shortname string `json:"Shortname,omitempty"` Filename string `json:"Filename,omitempty"` LineCount int `json:"Line Count,omitempty"` FileSize string `json:"File Size,omitempty"` Date float64 `json:"Date,omitempty"` Download string `json:"Download,omitempty"` Source string `json:"Source,omitempty"` Cached bool `json:"Cached"` }
func CheckAllCached ¶
func CheckAllCached(in []WordlistMetadata) ([]WordlistMetadata, error)
func Get ¶
func Get(ctx context.Context, names ...string) (ret []WordlistMetadata, err error)
Get will retrieve all the names from remote or local sources
func GetLocalDirListing ¶
func GetLocalDirListing() ([]WordlistMetadata, error)
func GetRemoteWordlists ¶
func GetRemoteWordlists() ([]WordlistMetadata, error)
func Save ¶
Save will save the specified names to the local cache. TODO: implement special case for "all"
func (WordlistMetadata) APIS ¶
func (w WordlistMetadata) APIS() (ret proute.APIS, err error)
API will atttempt to load a compiled kite API from disk. If this doesnt exist, then we attempt to compile a local file to disk. If this local file doesnt exist, then we download it first and cache it
func (*WordlistMetadata) Cache ¶
func (w *WordlistMetadata) Cache() error
Cache will downlad the file and save it to disk
func (*WordlistMetadata) IsCached ¶
func (w *WordlistMetadata) IsCached() bool
Cached performs a single stat operation against the local directory to see if the file exists on disk. This is not efficient, but a few dozen stat calls never hurt anyone. If you want to go fast, use CheckAllCached
func (WordlistMetadata) LocalFilename ¶
func (w WordlistMetadata) LocalFilename() (string, error)
func (WordlistMetadata) LocalFilenamePanic ¶
func (w WordlistMetadata) LocalFilenamePanic() string
func (WordlistMetadata) LocalKiteFilename ¶
func (w WordlistMetadata) LocalKiteFilename() (string, error)
func (WordlistMetadata) Words ¶
func (w WordlistMetadata) Words() ([]string, error)
words will attempt to retrieve the words from the cache. If it fails, it will