Documentation ¶
Index ¶
- type HttpTransportAuthProvider
- type HttpTransportClient
- func (t *HttpTransportClient) AddAuthHeaders(req *http.Request)
- func (t *HttpTransportClient) AddCommonHeaders(req *http.Request)
- func (t *HttpTransportClient) Delete(path string, out any, params ...HttpTransportClientParams) error
- func (t *HttpTransportClient) GetJSON(path string, out any, params ...HttpTransportClientParams) error
- func (t *HttpTransportClient) Head(path string, params ...HttpTransportClientParams) (http.Header, int, error)
- func (t *HttpTransportClient) OpenSSEStream(path string) (<-chan stream.RorEvent, error)
- func (t *HttpTransportClient) OpenSSEStreamWithCallback(callback func(stream.RorEvent), path string) (<-chan struct{}, error)
- func (t *HttpTransportClient) ParseParams(req *http.Request, params ...HttpTransportClientParams)
- func (t *HttpTransportClient) PostJSON(path string, in any, out any, params ...HttpTransportClientParams) error
- func (t *HttpTransportClient) PutJSON(path string, in any, out any, params ...HttpTransportClientParams) error
- type HttpTransportClientConfig
- type HttpTransportClientOpts
- type HttpTransportClientParams
- type SSEClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HttpTransportClient ¶
type HttpTransportClient struct { Client *http.Client Config *HttpTransportClientConfig }
func (*HttpTransportClient) AddAuthHeaders ¶
func (t *HttpTransportClient) AddAuthHeaders(req *http.Request)
func (*HttpTransportClient) AddCommonHeaders ¶
func (t *HttpTransportClient) AddCommonHeaders(req *http.Request)
AddCommonHeaders adds common headers to the request
func (*HttpTransportClient) Delete ¶ added in v0.3.11
func (t *HttpTransportClient) Delete(path string, out any, params ...HttpTransportClientParams) error
func (*HttpTransportClient) GetJSON ¶
func (t *HttpTransportClient) GetJSON(path string, out any, params ...HttpTransportClientParams) error
func (*HttpTransportClient) Head ¶ added in v0.3.11
func (t *HttpTransportClient) Head(path string, params ...HttpTransportClientParams) (http.Header, int, error)
Head makes a HEAD request with the given path and params. It returns only the header and status code from the result, as it expects no body in return.
func (*HttpTransportClient) OpenSSEStream ¶ added in v0.3.5
func (t *HttpTransportClient) OpenSSEStream(path string) (<-chan stream.RorEvent, error)
func (*HttpTransportClient) OpenSSEStreamWithCallback ¶ added in v0.3.5
func (t *HttpTransportClient) OpenSSEStreamWithCallback(callback func(stream.RorEvent), path string) (<-chan struct{}, error)
func (*HttpTransportClient) ParseParams ¶ added in v0.1.6
func (t *HttpTransportClient) ParseParams(req *http.Request, params ...HttpTransportClientParams)
func (*HttpTransportClient) PostJSON ¶
func (t *HttpTransportClient) PostJSON(path string, in any, out any, params ...HttpTransportClientParams) error
func (*HttpTransportClient) PutJSON ¶
func (t *HttpTransportClient) PutJSON(path string, in any, out any, params ...HttpTransportClientParams) error
type HttpTransportClientConfig ¶
type HttpTransportClientConfig struct { // BaseURL is the base URL for the API // Example: https://api.example.com BaseURL string // AuthProvider is the provider for the authentication AuthProvider HttpTransportAuthProvider // Role is the role of the client Role string // Version is the version of the client Version rorversion.RorVersion }
HttpTransportClientConfig is the configuration for the HTTP transport client
type HttpTransportClientOpts ¶ added in v0.1.6
type HttpTransportClientOpts string
const ( HttpTransportClientOptsNoAuth HttpTransportClientOpts = "NOAUTH" HttpTransportClientOptsHeaders HttpTransportClientOpts = "HEADERS" HttpTransportClientOptsQuery HttpTransportClientOpts = "QUERY" HttpTransportClientTimeout HttpTransportClientOpts = "TIMEOUT" )
type HttpTransportClientParams ¶
type HttpTransportClientParams struct { Key HttpTransportClientOpts Value any }
type SSEClient ¶ added in v0.3.5
type SSEClient struct {
// contains filtered or unexported fields
}
func (*SSEClient) CheckRetry ¶ added in v0.3.5
func (*SSEClient) UnSetRetry ¶ added in v0.3.5
func (s *SSEClient) UnSetRetry()
Click to show internal directories.
Click to hide internal directories.