modulepackage
2.0.7
Repository: https://github.com/cloudfoundry/go-log-cache.git
Documentation: pkg.go.dev
# README
Log Cache - Go Client
A Go client for the Log Cache.
Getting Started
Installing
go get code.cloudfoundry.org/go-log-cache
Basic Usage
See examples.
Contributing
Cloud Foundry uses GitHub to manage reviews of pull requests and issues.
- If you have a trivial fix or improvement, go ahead and create a pull request.
- If you plan to do something more involved, first discuss your ideas in Slack. This will help avoid unnecessary work :).
- Make sure you've signed the CLA!
Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository.
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
# Functions
BuildWalker captures the sourceID and reader to be used with a Walker.
NewAlwaysRetryBackoff returns a new AlwaysRetryBackoff.
NewIngressClient creates a Client.
NewOauth2HTTPClient creates a new Oauth2HTTPClient.
NewRetryBackoff returns a new RetryBackoff.
NewRetryBackoffOnErr returns a new RetryBackoff that only backs off no errors.
Walk reads from the LogCache until the Visitor returns false.
Window crawls a reader incrementally to give the Visitor a batch of envelopes.
WithDescending set the 'descending' query parameter to true.
WithEndTime sets the 'end_time' query parameter to the given time.
WithEnvelopeTypes sets the 'envelope_types' query parameter to the given value.
WithHTTPClient sets the HTTP client.
WithLimit sets the 'limit' query parameter to the given value.
No description provided by the author
WithOauth2HTTPClient sets the HTTPClient for the Oauth2HTTPClient.
WithOauth2HTTPUser sets the username and password for user authentication.
No description provided by the author
No description provided by the author
No description provided by the author
WithPromQLTime returns a PromQLOption that configures the 'time' query parameter for a PromQL query.
WithViaGRPC enables gRPC instead of HTTP/1 for reading from LogCache.
WithWalkBackoff sets the Backoff strategy for an empty batch or error.
WithWalkDelay sets the value that the walk algorithm will consider "old" enough.
WithWalkDelayFunc allows custom logic to determine which envelopes are too new.
WithWalkEndTime sets the End time of the query.
WithWalkEnvelopeType sets the envelope_types of the query.
WithWalkLimit sets the Limit of the query.
WithWalkLogger is used to set the logger for the Walk.
No description provided by the author
WithWalkStartTime sets the Start time of the query.
WithWindowInterval sets the duration to advance the start and end of the query.
WithWindowLogger is used to set the logger for the Walk.
WithWindowStartTime sets the start time of the query.
WithWindowWidth sets the width (end-start=width) of the query.
# Variables
No description provided by the author
No description provided by the author
# Structs
AlwaysDoneBackoff returns false for both OnErr and OnEmpty.
AlwaysRetryBackoff returns true for both OnErr and OnEmpty after sleeping the given interval.
Client reads from LogCache via the RESTful or gRPC API.
Oauth2HTTPClient sets the "Authorization" header of any outgoing request.
No description provided by the author
No description provided by the author
RetryBackoff returns true for both OnErr and OnEmpty after sleeping the given interval for a limited number of times.
No description provided by the author
# Interfaces
Backoff is used to determine what to do if there is an empty batch or error.
ClientOption configures the LogCache client.
HTTPClient is an interface that represents a http.Client.
Oauth2Option configures the Oauth2HTTPClient.
WindowOption configures the Window algorithm.
# Type aliases
PromQLOption configures the URL that is used to submit the query.
Reader reads envelopes from LogCache.
ReadOption configures the URL that is used to submit the query.
Visitor is invoked for each envelope batch.
Walker walks a reader.
WalkOption overrides defaults for Walk.