internal

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMaxRetries     = errors.New("max retries reached")
	ErrContextIsNil   = errors.New("context must be non-nil")
	ErrKeyNotProvided = errors.New("api key not provided")
)

Functions

func GetURLWithAuthorizationHash added in v0.19.6

func GetURLWithAuthorizationHash(req api.EquinoxRequest) (string, error)

Generates an URL with the Authorization header if it exists. Don't want to store the Authorization header as key in plaintext.

func NewLogger added in v0.2.0

func NewLogger(config api.EquinoxConfig) zerolog.Logger

Types

type Client added in v0.19.0

type Client struct {
	IsCacheEnabled     bool
	IsRateLimitEnabled bool
	IsRetryEnabled     bool
	// contains filtered or unexported fields
}

func NewInternalClient added in v0.2.0

func NewInternalClient(config api.EquinoxConfig) *Client

func (*Client) Do added in v1.0.0

func (c *Client) Do(ctx context.Context, equinoxReq api.EquinoxRequest) (*http.Response, error)

Do sends the request n times from c.maxRetries and returns the response

The loop will always run at least once

func (*Client) Execute added in v0.19.0

func (c *Client) Execute(ctx context.Context, equinoxReq api.EquinoxRequest, target any) error

func (*Client) ExecuteRaw added in v0.19.6

func (c *Client) ExecuteRaw(ctx context.Context, equinoxReq api.EquinoxRequest) ([]byte, error)

ExecuteRaw executes a request without Get/Set from cache and returns []byte

func (*Client) GetDDragonLOLVersions added in v0.19.0

func (c *Client) GetDDragonLOLVersions(ctx context.Context, id string) ([]string, error)

func (*Client) Logger added in v0.19.0

func (c *Client) Logger(id string) zerolog.Logger

Used to access the internal logger, this is used to log events from other clients.

func (*Client) Request added in v0.19.0

func (c *Client) Request(ctx context.Context, logger zerolog.Logger, httpMethod string, urlComponents []string, methodID string, body any) (api.EquinoxRequest, error)

type Loggers added in v0.19.0

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

Jump to

Keyboard shortcuts

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