Add godoc to bus_types.go
@@ -29,7 +29,9 @@ import (
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +k8s:defaulter-gen=true
-// Bus represents the buses.channels.knative.dev CRD
+// Bus represents how channels and subscriptions should be managed and
+// corresponds to the buses.channels.knative.dev CRD. Buses will frequently, but
+// not always, be backed by an event broker.
type Bus struct {
meta_v1.TypeMeta `json:",inline"`
meta_v1.ObjectMeta `json:"metadata"`
@@ -37,23 +39,34 @@ type Bus struct {
Status BusStatus `json:"status,omitempty"`
}
-// BusSpec (what the user wants) for a bus
+// BusSpec specifies the Bus' parameters for Channels and Subscriptions, how the
+// provisioner and dispatcher for a bus should be run, and which volumes should
+// be mounted into them.
type BusSpec struct {
-
- // Parameters exposed by the bus for channels and subscriptions
+ // Parameters defines the parameters that must be passed by this Bus'
+ // Channels and their Subscriptions. Channels and Subscriptions fulfill
+ // these parameters with Arguments.
Parameters *BusParameters `json:"parameters,omitempty"`
- // Provisioner container definition to manage channels on the bus.
+ // Provisioner defines how the provisioner container for this bus should be
+ // run. Provisioners are responsible for provisioning the underlying
+ // infrastructure for Channels and Subscriptions. The exact work done by the
+ // provisioner varies by Bus; one example of work done by a provisioner
+ // could be creating a messaging topic that backs a channel.
Provisioner *kapi.Container `json:"provisioner,omitempty"`
- // Dispatcher container definition to use for the bus data plane.
+ // Dispatcher defines how the dispatcher container for this bus should be
+ // run. Dispatchers are responsible for performing two types of event
+ // dispatch: dispatching incoming events to the Bus' Channels and
+ // dispatching events in the Channel to the Channel's Subscriptions.
Dispatcher kapi.Container `json:"dispatcher"`
// Volumes to be mounted inside the provisioner or dispatcher containers
Volumes *[]kapi.Volume `json:"volumes,omitempty"`
}
-// BusParameters parameters exposed by the bus
+// BusParameters represents the arguments that must be passed by Channels and
+// Subscriptions.
type BusParameters struct {
// Channel configuration params for channels on the bus
