Documentation ¶
Index ¶
- Constants
- func IsCodeError(err error, code int) bool
- func IsNotFoundError(err error) bool
- func NewError(code int, message string) error
- func NewErrorf(code int, message string, args ...interface{}) error
- func NewHTTP2DialForEndpoint(e Endpoint) func(network, addr string, cfg *tls.Config) (net.Conn, error)
- func NewNotFoundError(msg string) error
- func NewUrl(parts ...string) string
- type Array
- type Authentication
- type AuthenticationGetter
- type Connection
- type Decoder
- type Endpoint
- type Error
- type Http2Configuration
- type HttpConfiguration
- type Request
- type RequestModifier
- type Response
- func Call(ctx context.Context, c Connection, method, url string, output interface{}, ...) (Response, error)
- func CallDelete(ctx context.Context, c Connection, url string, output interface{}, ...) (Response, error)
- func CallGet(ctx context.Context, c Connection, url string, output interface{}, ...) (Response, error)
- func CallHead(ctx context.Context, c Connection, url string, output interface{}, ...) (Response, error)
- func CallPatch(ctx context.Context, c Connection, url string, output interface{}, ...) (Response, error)
- func CallPost(ctx context.Context, c Connection, url string, output interface{}, ...) (Response, error)
- func CallPut(ctx context.Context, c Connection, url string, output interface{}, ...) (Response, error)
- type RetryWrapper
- type Wrapper
Constants ¶
View Source
const (
ApplicationJSON = "application/json"
)
View Source
const (
ApplicationVPack = "application/x-velocypack"
)
View Source
const (
ContentType = "content-type"
)
Variables ¶
This section is empty.
Functions ¶
func IsCodeError ¶
func IsNotFoundError ¶
func NewHTTP2DialForEndpoint ¶
func NewNotFoundError ¶
Types ¶
type Array ¶
type Array struct {
// contains filtered or unexported fields
}
func (*Array) UnmarshalJSON ¶
type Authentication ¶
func NewBasicAuth ¶
func NewBasicAuth(username, password string) Authentication
type AuthenticationGetter ¶
type AuthenticationGetter func(ctx context.Context, conn Connection) (Authentication, error)
type Connection ¶
type Connection interface { NewRequest(method string, urls ...string) (Request, error) NewRequestWithEndpoint(endpoint string, method string, urls ...string) (Request, error) Do(ctx context.Context, request Request, output interface{}) (Response, error) GetEndpoint() Endpoint SetEndpoint(e Endpoint) error GetAuthentication() Authentication SetAuthentication(a Authentication) error Decoder(contentType string) Decoder }
func NewHttp2Connection ¶
func NewHttp2Connection(config Http2Configuration) Connection
func NewHttpConnection ¶
func NewHttpConnection(config HttpConfiguration) Connection
func NewRetryWrapper ¶
func NewRetryWrapper(conn Connection, retries int, wrapper RetryWrapper) Connection
func RetryOn503 ¶
func RetryOn503(conn Connection, retries int) Connection
type Endpoint ¶
type Endpoint interface { // Get return one of endpoints if is valid, if no default one is returned Get(endpoints ...string) (string, bool) List() []string }
func NewEndpoints ¶
type Http2Configuration ¶
type Http2Configuration struct { Authentication Authentication Endpoint Endpoint ContentType string Transport *http2.Transport }
func (Http2Configuration) GetContentType ¶
func (h Http2Configuration) GetContentType() string
type HttpConfiguration ¶
type HttpConfiguration struct { Authentication Authentication Endpoint Endpoint ContentType string Transport http.RoundTripper }
func (HttpConfiguration) GetContentType ¶
func (h HttpConfiguration) GetContentType() string
type RequestModifier ¶
func WithBody ¶
func WithBody(i interface{}) RequestModifier
func WithFragment ¶
func WithFragment(s string) RequestModifier
func WithQuery ¶
func WithQuery(s, value string) RequestModifier
func WithTransactionID ¶
func WithTransactionID(transactionID string) RequestModifier
type Response ¶
func Call ¶
func Call(ctx context.Context, c Connection, method, url string, output interface{}, modifiers ...RequestModifier) (Response, error)
func CallDelete ¶
func CallDelete(ctx context.Context, c Connection, url string, output interface{}, modifiers ...RequestModifier) (Response, error)
func CallGet ¶
func CallGet(ctx context.Context, c Connection, url string, output interface{}, modifiers ...RequestModifier) (Response, error)
func CallHead ¶
func CallHead(ctx context.Context, c Connection, url string, output interface{}, modifiers ...RequestModifier) (Response, error)
func CallPatch ¶
func CallPatch(ctx context.Context, c Connection, url string, output interface{}, body interface{}, modifiers ...RequestModifier) (Response, error)
func CallPost ¶
func CallPost(ctx context.Context, c Connection, url string, output interface{}, body interface{}, modifiers ...RequestModifier) (Response, error)
func CallPut ¶
func CallPut(ctx context.Context, c Connection, url string, output interface{}, body interface{}, modifiers ...RequestModifier) (Response, error)
type RetryWrapper ¶
type Wrapper ¶
type Wrapper func(c Connection) Connection
func NewJWTAuthWrapper ¶
func WrapAuthentication ¶
func WrapAuthentication(getter AuthenticationGetter) Wrapper
Source Files ¶
- auth.go
- auth_basic_impl.go
- auth_header_impl.go
- auth_jwt_impl.go
- call.go
- connection.go
- connection_http.go
- connection_http2.go
- connection_http_internal.go
- connection_http_json.go
- connection_http_request.go
- connection_http_response.go
- connection_http_vpack.go
- connection_with_reauthentication.go
- data_array.go
- data_stream.go
- decoder.go
- endpoint.go
- error.go
- modifiers.go
- retry_wrapper.go
Click to show internal directories.
Click to hide internal directories.