utils

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Download

func Download(opts *DownloadOptions) error

func DownloadWithSpinner

func DownloadWithSpinner(opts *DownloadOptions) error

func Extract added in v0.0.5

func Extract(path string, opts *ExtractOptions) (err error)

func GetKey

func GetKey() (string, error)

func ReadAllFromReader

func ReadAllFromReader(r StringReader) ([]string, error)

func ResolveFileOrValue

func ResolveFileOrValue(value string) ([]string, error)

func ValidateDomain added in v0.0.4

func ValidateDomain(s string) error

func ValidateIP added in v0.0.4

func ValidateIP(s string) error

func ValidateNetworkIndicator added in v0.0.4

func ValidateNetworkIndicator(s string) error

func ValidateULID

func ValidateULID(s string) error

func ValidateURL

func ValidateURL(s string) error

func ValidateUUID

func ValidateUUID(s string) error

Types

type APIClient

type APIClient struct {
	*api.Client
}

func NewAPIClient

func NewAPIClient() (*APIClient, error)

type BatchJSONResultPair

type BatchJSONResultPair struct {
	Key    string          `json:"key"`
	Result json.RawMessage `json:"result"`
}

func NewBatchJSONResultPairs

func NewBatchJSONResultPairs(keys []string, results []mo.Result[*api.Response]) []*BatchJSONResultPair

type Database added in v0.0.5

type Database struct {
	*bbolt.DB
}

func NewDatabase added in v0.0.5

func NewDatabase() (d *Database, err error)

func (*Database) Close added in v0.0.5

func (d *Database) Close() error

func (*Database) DeleteDataDump added in v0.0.5

func (d *Database) DeleteDataDump(path string) error

func (*Database) GetDataDump added in v0.0.5

func (d *Database) GetDataDump(path string) (localPath string, exists bool, err error)

func (*Database) HasDataDumpBeenDownloaded added in v0.0.5

func (d *Database) HasDataDumpBeenDownloaded(path string) (bool, error)

func (*Database) SetDataDump added in v0.0.5

func (d *Database) SetDataDump(path, localPath string) error

type DownloadOption

type DownloadOption = func(*DownloadOptions)

func WithDownloadClient

func WithDownloadClient(client *APIClient) DownloadOption

func WithDownloadDOM

func WithDownloadDOM(uuid string) DownloadOption

func WithDownloadDirectoryPrefix added in v0.0.5

func WithDownloadDirectoryPrefix(directoryPrefix string) DownloadOption

func WithDownloadForce

func WithDownloadForce(force bool) DownloadOption

func WithDownloadOutput

func WithDownloadOutput(output string) DownloadOption

func WithDownloadScreenshot

func WithDownloadScreenshot(uuid string) DownloadOption

func WithDownloadSilent

func WithDownloadSilent(silent bool) DownloadOption

func WithDownloadURL

func WithDownloadURL(path string) DownloadOption

type DownloadOptions

type DownloadOptions struct {
	// contains filtered or unexported fields
}

func NewDownloadOptions

func NewDownloadOptions(opts ...DownloadOption) *DownloadOptions

type ExtractOption added in v0.0.5

type ExtractOption func(*ExtractOptions)

func WithExtractDirectoryPrefix added in v0.0.5

func WithExtractDirectoryPrefix(directoryPrefix string) ExtractOption

func WithExtractForce added in v0.0.5

func WithExtractForce(force bool) ExtractOption

type ExtractOptions added in v0.0.5

type ExtractOptions struct {
	// contains filtered or unexported fields
}

func NewExtractOptions added in v0.0.5

func NewExtractOptions(opts ...ExtractOption) *ExtractOptions

type FilteredStringReader

type FilteredStringReader struct {
	// contains filtered or unexported fields
}

func NewFilteredStringReader

func NewFilteredStringReader(r StringReader, validateFn func(string) error) *FilteredStringReader

func (*FilteredStringReader) Err

func (f *FilteredStringReader) Err() error

func (*FilteredStringReader) Next

func (f *FilteredStringReader) Next() bool

func (*FilteredStringReader) ReadString

func (f *FilteredStringReader) ReadString() (s string, err error)

func (*FilteredStringReader) Value

func (f *FilteredStringReader) Value() string

type KeyManager

type KeyManager struct{}

func NewKeyManager

func NewKeyManager() *KeyManager

func (*KeyManager) CheckService

func (tm *KeyManager) CheckService() error

func (*KeyManager) GetKey

func (tm *KeyManager) GetKey() (string, error)

func (*KeyManager) RemoveKey

func (tm *KeyManager) RemoveKey() error

func (*KeyManager) SetKey

func (tm *KeyManager) SetKey(token string) error

type MappedStringReader

type MappedStringReader struct {
	// contains filtered or unexported fields
}

func NewMappedStringReader

func NewMappedStringReader(r StringReader, mapFn func(string) ([]string, error)) *MappedStringReader

func (*MappedStringReader) Err

func (msr *MappedStringReader) Err() error

func (*MappedStringReader) Next

func (msr *MappedStringReader) Next() bool

func (*MappedStringReader) Pop

func (msr *MappedStringReader) Pop() (string, error)

func (*MappedStringReader) ReadString

func (msr *MappedStringReader) ReadString() (string, error)

func (*MappedStringReader) Value

func (msr *MappedStringReader) Value() string

type SearchResults

type SearchResults struct {
	Results []json.RawMessage `json:"results"`
	HasMore bool              `json:"has_more"`
	Total   int               `json:"total"`
}

func NewSearchResults

func NewSearchResults() SearchResults

type StringArrayReader

type StringArrayReader struct {
	// contains filtered or unexported fields
}

func NewStringArrayReader

func NewStringArrayReader(strings []string) *StringArrayReader

func (*StringArrayReader) Err

func (sar *StringArrayReader) Err() error

func (*StringArrayReader) Next

func (sar *StringArrayReader) Next() bool

func (*StringArrayReader) ReadString

func (sar *StringArrayReader) ReadString() (string, error)

func (*StringArrayReader) Value

func (sar *StringArrayReader) Value() string

type StringIOReader

type StringIOReader struct {
	// contains filtered or unexported fields
}

func NewStringIOReader

func NewStringIOReader(r io.Reader) *StringIOReader

func (*StringIOReader) Err

func (sir *StringIOReader) Err() error

func (*StringIOReader) Next

func (sir *StringIOReader) Next() bool

func (*StringIOReader) ReadString

func (sir *StringIOReader) ReadString() (string, error)

func (*StringIOReader) Value

func (sir *StringIOReader) Value() string

type StringReader

type StringReader interface {
	Next() bool
	ReadString() (string, error)
	Value() string
	Err() error
}

func StringReaderFromCmdArgs

func StringReaderFromCmdArgs(args []string) StringReader

Jump to

Keyboard shortcuts

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