Documentation ¶
Overview ¶
Package client implements the Turbine service interface by constructing an HTTP client to a specified backend api server.
In order to configure the desired Turbine service and Endpoint must be specified which then may be passed into the constructor for a HTTP service:
endpoint, err := NewEndpoint(HTTP, "dev.turbinelabs.io", 8080) if err != nil { return err } service := NewAll(Endpoint, apiKey)
For a detailed discussion about what each of these values mean see method docs.
Package client is a generated GoMock package.
Index ¶
- func NewAccessTokenV1(dest apihttp.Endpoint) (*httpAccessTokenV1, error)
- func NewAdmin(dest apihttp.Endpoint, apiKey string, clientApp App) (service.Admin, error)
- func NewAll(dest apihttp.Endpoint, apiKey string, clientApp App) (service.All, error)
- func NewBatchingStatsV2Client(maxDelay time.Duration, maxSize int, dest apihttp.Endpoint, apiKey string, ...) (statsapi.StatsService, error)
- func NewClusterV1(dest apihttp.Endpoint) (*httpClusterV1, error)
- func NewDomainV1(dest apihttp.Endpoint) (*httpDomainV1, error)
- func NewHistoryV1(dest apihttp.Endpoint) (*httpHistoryV1, error)
- func NewListenerV1(dest apihttp.Endpoint) (*httpListenerV1, error)
- func NewProxyV1(dest apihttp.Endpoint) (*httpProxyV1, error)
- func NewRouteV1(dest apihttp.Endpoint) (*httpRouteV1, error)
- func NewSharedRulesV1(dest apihttp.Endpoint) (*httpSharedRulesV1, error)
- func NewStatsV2Client(dest apihttp.Endpoint, apiKey string, clientApp App, exec executor.Executor) (statsapi.StatsService, error)
- func NewUserV1(dest apihttp.Endpoint) (*httpUserV1, error)
- func NewZoneV1(dest apihttp.Endpoint) (*httpZoneV1, error)
- type App
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAccessTokenV1 ¶
NewAccessTokenV1 constructs a new HTTP backed AccessToken API implementation.
Parameters:
dest - service handling our HTTP requests; cf. NewService
func NewAdmin ¶
Create a new Admin backed by a Turbine api server at dest. Communication with this server will happen via HTTP (or HTTPS as specified in the Endpoint) and will sign your requests with the provided apiKey. The Endpoint is copied so changes to headers or clients must be made before invoking NewAdmin.
Service creation can not fail but it does not guarantee that the target Endpoint is a valid, or live, Turbine service.
Parameters: See NewAll.
func NewAll ¶
Create a new Service backed by a Turbine api server at dest. Communication with this server will happen via HTTP (or HTTPS as specified in the Endpoint) and will sign your requests with the provided apiKey. The Endpoint is copied so changes to headers or clients must be made before invoking NewAdmin.
Service creation can not fail but it does not guarantee that the target Endpoint is a valid, or live, Turbine service.
Parameters:
dest - a server we want to communicate with, construct via apihttp.NewEndpoint apiKey - an API key assigned to your organization during setup process
func NewBatchingStatsV2Client ¶
func NewBatchingStatsV2Client( maxDelay time.Duration, maxSize int, dest apihttp.Endpoint, apiKey string, clientApp App, exec executor.Executor, logger *log.Logger, ) (statsapi.StatsService, error)
NewBatchingStatsV2Client returns a non-blocking implementation of StatsServiceV2. Each invocation of ForwardV2 accepts a single Payload. The client will return immediately, reporting that all stats were successfully sent. Internally, the stats are buffered until the buffer contains at least maxSize stats or maxDelay time has elapsed since the oldest stats in the buffer were added. At that point the buffered stats are forwarded. Failures are logged, but not reported to the caller. Separate buffers and deadlines are maintained for each unique source, node, and zone combination. In addition, the buffering is optimized to assume that the payloads proxy, proxy version and named limits do not vary across payloads. If the proxy, proxy version, or limits (with the same name) vary across payloads, buffers will be flushed prematurely.
func NewClusterV1 ¶
Construct a new HTTP backed api.Cluster API implementation.
Parameters:
dest - service handling our HTTP requests; cf. NewService
func NewDomainV1 ¶
Construct a new HTTP backed api.Domain API implementation.
Parameters:
dest - service handling our HTTP requests; cf. NewService
func NewHistoryV1 ¶
Construct a new HTTP backed History API implementation.
Parameters:
dest - service handling our HTTP requests; cf. NewService
func NewListenerV1 ¶
Construct a new HTTP backed api.Listener API implementation.
Parameters:
dest - service handling our HTTP requests; cf. NewService
func NewProxyV1 ¶
Construct a new HTTP backed api.Proxy API implementation.
Parameters:
dest - service handling our HTTP requests; cf. NewService
func NewRouteV1 ¶
Construct a new HTTP backed api.Route API implementation.
Parameters:
dest - service handling our HTTP requests; cf. NewService
func NewSharedRulesV1 ¶
Construct a new HTTP backed api.SharedRules API implementation.
Parameters:
dest - service handling our HTTP requests; cf. NewService
func NewStatsV2Client ¶
func NewStatsV2Client( dest apihttp.Endpoint, apiKey string, clientApp App, exec executor.Executor, ) (statsapi.StatsService, error)
NewStatsV2Client returns a blocking implementation of StatsForwardService and StatsQueryService. Each invocation of ForwardV2 accepts a single Payload, issues a forwarding request to a remote stats-server and awaits a response.