dn0 opened a new pull request, #1324:
URL: https://github.com/apache/pulsar-client-go/pull/1324

   
   ### Motivation
   
   This change adds public methods for managing [offload 
policies](https://pulsar.apache.org/docs/next/tiered-storage-overview/) at the 
namespace and topic level.
   The main motivation is to later use these functions in the Terraform 
provider which we are planning to extend as well to be able to manage 
offloading policies via Terraform.
   
   ### Modifications
   
   I was trying to figure out the naming to be consistent with the REST API and 
other methods.
   Feel free to suggest different naming structure.
   
   Added the following methods:
   - Namespace:
   ```go
   // GetOffload returns the offload configuration for a namespace
   GetOffload(namespace utils.NameSpaceName) (*utils.OffloadPolicies, error)
   
   // SetOffload sets the offload configuration on a namespace
   SetOffload(namespace utils.NameSpaceName, policy *utils.OffloadPolicies) 
error
   
   // DeleteOffload removes the offload configuration from a namespace
   DeleteOffload(namespace utils.NameSpaceName) error
   ```
   
   - Topic
   ```go
   // GetOffload returns the offload configuration for a topic
   GetOffload(topic utils.TopicName, applied bool) (*utils.OffloadPolicies, 
error)
   
   // SetOffload sets the offload policy for a topic
   SetOffload(topic utils.TopicName, policy *utils.OffloadPolicies) error
   
   // DeleteOffload removes the offload configuration on a topic
   DeleteOffload(topic utils.TopicName) error
   ```
   
   ### Verifying this change
   
   This change added tests and can be verified as follows:
   
   - Added Go tests, which, however require a running cluster (part of the 
scripts/CI
   
   
   ### Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): `no`
     - The public API: `yes`
     - The schema: `don't know`
     - The default values of configurations: `yes`
     - The wire protocol: `no`
   
   ### Documentation
   
     - Does this pull request introduce a new feature? `yes`
     - If yes, how is the feature documented? `GoDocs?`
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to