requests

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const MAX_PAGE_SIZE = 1000

Variables

This section is empty.

Functions

This section is empty.

Types

type Body

type Body interface {
	Validate() error
}

type KeysetBasedList added in v1.1.1

type KeysetBasedList struct {
	Limit       int                     `json:"limit"`
	Cursor      int                     `json:"cursor"`
	DateFilters []relational.DateFilter `json:"date_filters"`
}

func (*KeysetBasedList) ParseDatesToUnix added in v1.1.1

func (r *KeysetBasedList) ParseDatesToUnix(validDBColumns []string) error

func (*KeysetBasedList) Validate added in v1.1.1

func (r *KeysetBasedList) Validate() error

type OffsetBasedList added in v1.1.1

type OffsetBasedList struct {
	Limit       int                     `json:"limit"`
	Offset      int                     `json:"offset"`
	DateFilters []relational.DateFilter `json:"date_filters"`
}

func (*OffsetBasedList) ParseDatesToUnix added in v1.1.1

func (r *OffsetBasedList) ParseDatesToUnix(validDBColumns []string) error

func (*OffsetBasedList) Validate added in v1.1.1

func (r *OffsetBasedList) Validate() error

type Option added in v1.1.2

type Option func(*Request)

Option is a function that modifies the Request.

func WithTimeout added in v1.1.2

func WithTimeout(timeout time.Duration) Option

WithTimeout returns an Option that sets the timeout for the request context.

type Request

type Request struct {
	ID        string
	APIKey    string
	APISecret string
	IP        string
	Client    string
	Body      Body
	Context   context.Context
	Cancel    context.CancelFunc
}

func New

func New(header http.Header, ip string, opts ...Option) *Request

func (*Request) SetBody

func (r *Request) SetBody(body Body)

func (*Request) VerifyHeaders

func (r *Request) VerifyHeaders() error

Jump to

Keyboard shortcuts

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