package
0.1.0-alpha.12
Repository: https://github.com/openlayer-ai/openlayer-go.git
Documentation: pkg.go.dev
# Functions
WithAPIKey returns a RequestOption that sets the client setting "api_key".
WithBaseURL returns a RequestOption that sets the BaseURL for the client.
WithEnvironmentProduction returns a RequestOption that sets the current environment to be the "production" environment.
WithHeader returns a RequestOption that sets the header value to the associated key.
WithHeaderAdd returns a RequestOption that adds the header value to the associated key.
WithHeaderDel returns a RequestOption that deletes the header value(s) associated with the given key.
WithHTTPClient returns a RequestOption that changes the underlying [http.Client] used to make this request, which by default is [http.DefaultClient].
WithJSONDel returns a RequestOption that deletes the body's JSON value associated with the key.
WithJSONSet returns a RequestOption that sets the body's JSON value associated with the key.
WithMaxRetries returns a RequestOption that sets the maximum number of retries that the client attempts to make.
WithMiddleware returns a RequestOption that applies the given middleware to the requests made.
WithQuery returns a RequestOption that sets the query value to the associated key.
WithQueryAdd returns a RequestOption that adds the query value to the associated key.
WithQueryDel returns a RequestOption that deletes the query value(s) associated with the key.
WithRequestBody returns a RequestOption that provides a custom serialized body with the given content type.
WithRequestTimeout returns a RequestOption that sets the timeout for each request attempt.
WithResponseBodyInto returns a RequestOption that overwrites the deserialization target with the given destination.
WithResponseInto returns a RequestOption that copies the [*http.Response] into the given address.
# Type aliases
Middleware is a function which intercepts HTTP requests, processing or modifying them, and then passing the request to the next middleware or handler in the chain by calling the provided MiddlewareNext function.
MiddlewareNext is a function which is called by a middleware to pass an HTTP request to the next stage in the middleware chain.
RequestOption is an option for the requests made by the openlayer API Client which can be supplied to clients, services, and methods.