utils

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: Apache-2.0 Imports: 16 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 GetKey

func GetKey() (string, error)

func ReadAllFromReader

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

func ResolveFileOrValue

func ResolveFileOrValue(value string) ([]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 DownloadOption

type DownloadOption = func(*DownloadOptions)

func WithDownloadClient

func WithDownloadClient(client *APIClient) DownloadOption

func WithDownloadDOM

func WithDownloadDOM(uuid 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 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