@@ -55,7 +55,7 @@ func (s *GRPCBrokerService) List(ctx context.Context, listOpts types.ListOptions
5555
5656 evts := []* ce.Event {}
5757 for _ , res := range resources {
58- evt , err := encodeResourceSpec (res , types .ResyncResponseAction )
58+ evt , err := EncodeResourceSpec (res , types .ResyncResponseAction )
5959 if err != nil {
6060 return nil , kubeerrors .NewInternalError (err )
6161 }
@@ -68,13 +68,13 @@ func (s *GRPCBrokerService) List(ctx context.Context, listOpts types.ListOptions
6868// HandleStatusUpdate processes the resource status update from the agent.
6969func (s * GRPCBrokerService ) HandleStatusUpdate (ctx context.Context , evt * ce.Event ) error {
7070 // decode the cloudevent data as resource with status
71- resource , err := decodeResourceStatus (evt )
71+ resource , err := DecodeResourceStatus (evt )
7272 if err != nil {
7373 return fmt .Errorf ("failed to decode cloudevent: %v" , err )
7474 }
7575
7676 // handle the resource status update according status update type
77- if err := handleStatusUpdate (ctx , resource , s .resourceService , s .statusEventService ); err != nil {
77+ if err := HandleStatusUpdate (ctx , resource , s .resourceService , s .statusEventService ); err != nil {
7878 return fmt .Errorf ("failed to handle resource status update %s: %s" , resource .ID , err .Error ())
7979 }
8080
@@ -252,7 +252,7 @@ func (s *GRPCBroker) Get(ctx context.Context, resourceID string, action types.Ev
252252 return nil , kubeerrors .NewInternalError (err )
253253 }
254254
255- return encodeResourceSpec (resource , action )
255+ return EncodeResourceSpec (resource , action )
256256}
257257
258258// On StatusUpdate will be called on each new status event inserted into db.
@@ -306,14 +306,14 @@ func (s *GRPCBroker) PredicateEvent(ctx context.Context, eventID string) (bool,
306306 return s .eventServer .Subscribers ().Has (resource .ConsumerName ), nil
307307}
308308
309- // decodeResourceStatus translates a CloudEvent into a resource containing the status JSON map.
310- func decodeResourceStatus (evt * ce.Event ) (* api.Resource , error ) {
309+ // DecodeResourceStatus translates a CloudEvent into a resource containing the status JSON map.
310+ func DecodeResourceStatus (evt * ce.Event ) (* api.Resource , error ) {
311311 codec := cloudevents .NewCodec (source )
312312 return codec .Decode (evt )
313313}
314314
315- // encodeResourceSpec translates a resource spec JSON map into a CloudEvent.
316- func encodeResourceSpec (resource * api.Resource , action types.EventAction ) (* ce.Event , error ) {
315+ // EncodeResourceSpec translates a resource spec JSON map into a CloudEvent.
316+ func EncodeResourceSpec (resource * api.Resource , action types.EventAction ) (* ce.Event , error ) {
317317 eventType := types.CloudEventsType {
318318 CloudEventsDataType : workpayload .ManifestBundleEventDataType ,
319319 SubResource : types .SubResourceSpec ,
0 commit comments