Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client): expose a requester interface
The patch adds a public Requester interfaces which will allow derived projects to use the Pebble client to extend the available commands. The interfaces is designed to also allow completely replacing the default implementation provided by the Pebble client. The changes made in the patch has been done in a way to produce as small as possible diffs (we keep doSync/doAsyc wrappers). The default interface has been implemented in the client.go file to allow reviewers to easily identify which code was added, and which is existing code. The following changes are made: 1. The ResultInfo type previously returned by doSync and doAsync private function are removed. Although this is a publicly exposed type, the return value as of today has always been discarded, and the struct is currently empty. 2. ResultInfo has been replaced by RequestResponse. 3. The logs client request now uses the same retry logic on GET failure, as any other GET request. This is previously not possible because the retry logic and response unmarshall code was bundled, not allow raw access to the HTTP body. 4. The CloseIdleConnections() call has been removed as the final Daemon termination step (now in line with Snapd daemon termination). The garbage collector does the job just fine here.
- Loading branch information