Documentation
¶
Overview ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backoff ¶
type Backoff struct {
// contains filtered or unexported fields
}
Backoff implements exponential backoff with randomized wait times
func NewBackoff ¶
func NewBackoff(ctx context.Context, cfg BackoffConfig) *Backoff
NewBackoff creates a Backoff object. Pass a Context that can also terminate the operation.
func (*Backoff) Err ¶
Err returns the reason for terminating the backoff, or nil if it didn't terminate
func (*Backoff) NumRetries ¶
NumRetries returns the number of retries so far
type BackoffConfig ¶
type BackoffConfig struct { MinBackoff time.Duration // start backoff at this level MaxBackoff time.Duration // increase exponentially to this level MaxRetries int // give up after this many; zero means infinite retries }
BackoffConfig configures a Backoff
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client for pushing logs in snappy-compressed protos over HTTP.
func NewWithDefaults ¶
NewWithDefaults makes a new Client with default config.