MCPcopy
hub / github.com/IBM/sarama / NewClusterAdminFromClient

Function NewClusterAdminFromClient

admin.go:228–240  ·  view source on GitHub ↗

NewClusterAdminFromClient creates a new ClusterAdmin using the given client. Note that underlying client will also be closed on admin's Close() call.

(client Client)

Source from the content-addressed store, hash-verified

226// NewClusterAdminFromClient creates a new ClusterAdmin using the given client.
227// Note that underlying client will also be closed on admin's Close() call.
228func NewClusterAdminFromClient(client Client) (ClusterAdmin, error) {
229 // make sure we can retrieve the controller
230 _, err := client.Controller()
231 if err != nil {
232 return nil, err
233 }
234
235 ca := &clusterAdmin{
236 client: client,
237 conf: client.Config(),
238 }
239 return ca, nil
240}
241
242func (ca *clusterAdmin) Close() error {
243 return ca.client.Close()

Calls 2

ControllerMethod · 0.65
ConfigMethod · 0.65