Documentation
¶
Index ¶
- func IsAsyncErrorNotFound(err error) bool
- func IsAsyncJobInProgress(err error) (string, bool)
- func NewAsyncConnection(c driver.Connection) driver.Connection
- func NewClosedConnection() driver.Connection
- func NewContextDialer(connectionWrapper TransportConnWrap) proxy.ContextDialer
- func WithAsyncID(ctx context.Context, id string) context.Context
- type Auth
- type Config
- type Connection
- type ConnectionConfig
- type ConnectionWrap
- type ContextKey
- type Executor
- type Factory
- type TransportConnWrap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsAsyncErrorNotFound ¶
func IsAsyncJobInProgress ¶
func NewAsyncConnection ¶
func NewAsyncConnection(c driver.Connection) driver.Connection
func NewClosedConnection ¶
func NewClosedConnection() driver.Connection
func NewContextDialer ¶
func NewContextDialer(connectionWrapper TransportConnWrap) proxy.ContextDialer
NewContextDialer returns dialer which wraps existing connection with a network connection wrapper.
Types ¶
type Auth ¶
type Auth func() (driver.Authentication, error)
type Config ¶
type Config func() (http.ConnectionConfig, error)
type Connection ¶
type Connection interface {
Execute(ctx context.Context, method string, endpoint string, body io.Reader) (io.ReadCloser, int, error)
}
func NewConnection ¶
func NewConnection(c ConnectionConfig) Connection
type ConnectionConfig ¶
type ConnectionConfig struct {
// host is address to a server.
Host string
// auth is a pure jwt bearer token: "bearer <jwt_token>"
Auth *string
// ConnWrapper wraps original network connection with an additional functionality provided by a caller.
ConnWrapper TransportConnWrap
}
ConnectionConfig describes how connection can be created.
type ConnectionWrap ¶
type ConnectionWrap func(c driver.Connection) driver.Connection
type ContextKey ¶
type ContextKey string
type Executor ¶
type Executor[IN, OUT interface{}] interface {
ExecuteGet(ctx context.Context, endpoint string) (*OUT, int, error)
Execute(ctx context.Context, method string, endpoint string, in IN) (*OUT, int, error)
}
func NewExecutor ¶
func NewExecutor[IN, OUT interface{}](conn Connection) Executor[IN, OUT]
type Factory ¶
type Factory interface {
Connection(hosts ...string) (driver.Connection, error)
AgencyConnection(hosts ...string) (driver.Connection, error)
Client(hosts ...string) (driver.Client, error)
Agency(hosts ...string) (agency.Agency, error)
RawConnection(host string) (Connection, error)
GetAuth() Auth
}
func NewFactory ¶
Click to show internal directories.
Click to hide internal directories.