@@ -31,10 +31,10 @@ import (
3131//
3232// Distributor implements the KeyMaterialReader interface. Provider
3333// implementations may choose to do the following:
34- // - return a distributor as part of their KeyMaterialReader() method.
35- // - invoke the distributor 's Set() method whenever they have new key material.
36- // - watch the channel returned by the distributor's Done() method to get
37- // notified when the distributor is closed.
34+ // - return a Distributor as part of their KeyMaterialReader() method.
35+ // - invoke the Distributor 's Set() method whenever they have new key material.
36+ // - watch the channel returned by the Distributor. Done() method to get
37+ // notified when the Distributor is closed.
3838type Distributor struct {
3939 // mu protects the underlying key material.
4040 mu sync.Mutex
@@ -45,7 +45,7 @@ type Distributor struct {
4545 // availability of key material.
4646 ready * grpcsync.Event
4747 // done channel to notify provider implementations and unblock any
48- // KeyMaterial() calls, once the distributor is closed.
48+ // KeyMaterial() calls, once the Distributor is closed.
4949 closed * grpcsync.Event
5050}
5151
@@ -57,15 +57,15 @@ func NewDistributor() *Distributor {
5757 }
5858}
5959
60- // Set updates the key material in the distributor with km.
60+ // Set updates the key material in the Distributor with km.
6161//
62- // Provider implementations which use the distributor must not modify the
62+ // Provider implementations which use the Distributor must not modify the
6363// contents of the KeyMaterial struct pointed to by km.
6464//
6565// A non-nil err value indicates the error that the provider implementation ran
6666// into when trying to fetch key material, and makes it possible to surface the
67- // error to the user. A non-nil error value passed here causes distributor's
68- // KeyMaterial() method to return nil key material.
67+ // error to the user. A non-nil error value passed here causes the
68+ // Distributor. KeyMaterial() method to return nil key material.
6969func (d * Distributor ) Set (km * KeyMaterial , err error ) {
7070 d .mu .Lock ()
7171 d .km = km
@@ -78,7 +78,7 @@ func (d *Distributor) Set(km *KeyMaterial, err error) {
7878 d .mu .Unlock ()
7979}
8080
81- // KeyMaterial returns the most recent key material provided to the distributor .
81+ // KeyMaterial returns the most recent key material provided to the Distributor .
8282// If no key material was provided at the time of this call, it will block until
8383// the deadline on the context expires or fresh key material arrives.
8484func (d * Distributor ) KeyMaterial (ctx context.Context ) (* KeyMaterial , error ) {
@@ -106,13 +106,13 @@ func (d *Distributor) keyMaterial() (*KeyMaterial, error) {
106106 return d .km , d .pErr
107107}
108108
109- // Close turns down the distributor , releases allocated resources and fails any
109+ // Close turns down the Distributor , releases allocated resources and fails any
110110// active KeyMaterial() call waiting for new key material.
111111func (d * Distributor ) Close () {
112112 d .closed .Fire ()
113113}
114114
115- // Done returns a channel which will be closed when the distributor is closed.
115+ // Done returns a channel which will be closed when the Distributor is closed.
116116func (d * Distributor ) Done () <- chan struct {} {
117117 return d .closed .Done ()
118118}
0 commit comments