Documentation
¶
Index ¶
- Variables
- func DfRowsAsStructList[sType any](d *Dataframe) ([]sType, error)
- func NewRequestEmitter(opts ...HTTPEmitterOpt) *httpEmitter
- type BadDataframe
- type Column
- type ColumnsNotFoundErr
- type Dataframe
- type DfOpts
- type FileFilter
- type FileFilterOption
- type HTTPEmitter
- type HTTPEmitterOpt
- func WithHTTP(host string, path string) HTTPEmitterOpt
- func WithHTTPS(host string, path string) HTTPEmitterOpt
- func WithProvidedHttpClient(c *http.Client) HTTPEmitterOpt
- func WithRedirectFunc(redirectFunc func(req *http.Request, via []*http.Request) error) HTTPEmitterOpt
- func WithTimeout(timeout time.Duration) HTTPEmitterOpt
- type HeaderError
- type HeaderInterpretErr
- type HeaderMismatchErr
- type Record
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidStatus = fmt.Errorf("invalid status code received") ErrTimeout = fmt.Errorf("request timed out") ErrCanceled = fmt.Errorf("request was canceled") )
Custom errors for better error handling
Functions ¶
func DfRowsAsStructList ¶
DfRowsAsStructList the dataframe as a []sType representation; sType must have 'df' tags
func NewRequestEmitter ¶
func NewRequestEmitter(opts ...HTTPEmitterOpt) *httpEmitter
Types ¶
type BadDataframe ¶
type BadDataframe struct{}
type ColumnsNotFoundErr ¶
func (*ColumnsNotFoundErr) AsMap ¶
func (e *ColumnsNotFoundErr) AsMap() map[string]any
func (*ColumnsNotFoundErr) Error ¶
func (e *ColumnsNotFoundErr) Error() string
func (*ColumnsNotFoundErr) Header ¶
func (e *ColumnsNotFoundErr) Header() []string
func (*ColumnsNotFoundErr) Other ¶
func (e *ColumnsNotFoundErr) Other() []string
type Dataframe ¶
func NewDataframe ¶
type DfOpts ¶
func WithInterpretedColumns ¶
func WithInterpretedColumns() DfOpts
func WithProvidedColumns ¶
func WithRecordsFromFiles ¶
type FileFilter ¶
type FileFilter struct {
// contains filtered or unexported fields
}
func NewFileFilter ¶
func NewFileFilter(opts ...FileFilterOption) (*FileFilter, error)
func (FileFilter) Filter ¶
func (ff FileFilter) Filter() ([]string, error)
Filter filters the files in the provided directories and returns a list of absolute file paths
func (*FileFilter) SetDirs ¶
func (ff *FileFilter) SetDirs(d []string)
type FileFilterOption ¶
type FileFilterOption func(*FileFilter) error
func SetLoc ¶
func SetLoc(loc []string) FileFilterOption
func WithFileAge ¶
func WithFileAge(d time.Duration) FileFilterOption
func WithGlobPattern ¶
func WithGlobPattern(p string) FileFilterOption
type HTTPEmitter ¶
type HTTPEmitter interface {
Do(ctx context.Context, method string, body []byte) (*http.Response, error)
SetHeader(key, value string) HTTPEmitter
SetQueryParam(key, value string) HTTPEmitter
ChangePath(path string) HTTPEmitter
}
HTTPEmitter defines the contract for HTTP operations
type HTTPEmitterOpt ¶
type HTTPEmitterOpt func(*httpEmitter) error
func WithHTTP ¶
func WithHTTP(host string, path string) HTTPEmitterOpt
func WithHTTPS ¶
func WithHTTPS(host string, path string) HTTPEmitterOpt
func WithProvidedHttpClient ¶
func WithProvidedHttpClient(c *http.Client) HTTPEmitterOpt
func WithRedirectFunc ¶ added in v0.1.0
func WithTimeout ¶ added in v0.1.0
func WithTimeout(timeout time.Duration) HTTPEmitterOpt
type HeaderError ¶
type HeaderInterpretErr ¶
func (*HeaderInterpretErr) AsMap ¶
func (e *HeaderInterpretErr) AsMap() map[string]any
func (*HeaderInterpretErr) Error ¶
func (e *HeaderInterpretErr) Error() string
func (*HeaderInterpretErr) Header ¶
func (e *HeaderInterpretErr) Header() []string
func (*HeaderInterpretErr) Other ¶
func (e *HeaderInterpretErr) Other() []string
type HeaderMismatchErr ¶
func (*HeaderMismatchErr) AsMap ¶
func (e *HeaderMismatchErr) AsMap() map[string]any
func (*HeaderMismatchErr) Error ¶
func (e *HeaderMismatchErr) Error() string
func (*HeaderMismatchErr) Header ¶
func (e *HeaderMismatchErr) Header() []string
func (*HeaderMismatchErr) Other ¶
func (e *HeaderMismatchErr) Other() []string
Click to show internal directories.
Click to hide internal directories.