Documentation ¶
Index ¶
- Constants
- func NewCloudEventHandler(ctx context.Context, pub *Publisher) (http.Handler, error)
- func NewServer(h http.Handler, opts ServerOptions) *http.Server
- func Shutdown(ctx context.Context, s *http.Server, done chan<- struct{}, ...)
- type ContainerServiceClusterRollingEvent
- type ContainerServiceClusterSupportEndedEvent
- type ContainerServiceClusterSupportEndingEvent
- type ContainerServiceClusterSupportEvent
- type ContainerServiceEvent
- type ContainerServiceNewKubernetesVersionAvailableEvent
- type ContainerServiceNodePoolRollingFailedEvent
- type ContainerServiceNodePoolRollingStartedEvent
- type ContainerServiceNodePoolRollingSucceededEvent
- type Message
- type MessageBuilder
- type Options
- type Publisher
- type PublisherFunc
- type ServerOptions
Constants ¶
const ( // EventNewKubernetesVersionAvailable is the event type that is sent when a new Kubernetes version is available. EventNewKubernetesVersionAvailable = "Microsoft.ContainerService.NewKubernetesVersionAvailable" // EventClusterSupportEnding is the event type that is sent when support for a Kubernetes version is ending. EventClusterSupportEnding = "Microsoft.ContainerService.ClusterSupportEnding" // EventClusterSupportEnded is the event type that is sent when support for a Kubernetes version has ended. EventClusterSupportEnded = "Microsoft.ContainerService.ClusterSupportEnded" // EventNodePoolRollingStarted is the event type that is sent when a node pool rolling upgrade has started. EventNodePoolRollingStarted = "Microsoft.ContainerService.NodePoolRollingStarted" // EventNodePoolRollingSucceeded is the event type that is sent when a node pool rolling upgrade has succeeded. EventNodePoolRollingSucceeded = "Microsoft.ContainerService.NodePoolRollingSucceeded" // EventNodePoolRollingFailed is the event type that is sent when a node pool rolling upgrade has failed. EventNodePoolRollingFailed = "Microsoft.ContainerService.NodePoolRollingFailed" )
const (
// AzureEventGridOrigin represents the origin string for Azure Event Grid.
AzureEventGridOrigin = "eventgrid.azure.net"
)
Variables ¶
This section is empty.
Functions ¶
func NewCloudEventHandler ¶
NewCloudEventHandler creates a new CloudEvent handler with the given Publisher.
Types ¶
type ContainerServiceClusterRollingEvent ¶
type ContainerServiceClusterRollingEvent struct {
NodePoolName string `json:"nodePoolName"`
}
ContainerServiceClusterRollingEvent represents the commonality for node pool rolling events.
type ContainerServiceClusterSupportEndedEvent ¶
type ContainerServiceClusterSupportEndedEvent struct {
ContainerServiceClusterSupportEvent
}
ContainerServiceClusterSupportEndedEvent is the event sent when support for a Kubernetes version has ended.
func (ContainerServiceClusterSupportEndedEvent) String ¶
func (e ContainerServiceClusterSupportEndedEvent) String() string
String returns a string representation of the ContainerServiceClusterSupportEndedEvent.
type ContainerServiceClusterSupportEndingEvent ¶
type ContainerServiceClusterSupportEndingEvent struct {
ContainerServiceClusterSupportEvent
}
ContainerServiceClusterSupportEndingEvent is the event sent when support for a Kubernetes version is ending.
func (ContainerServiceClusterSupportEndingEvent) String ¶
func (e ContainerServiceClusterSupportEndingEvent) String() string
String returns a string representation of the ContainerServiceClusterSupportEndingEvent.
type ContainerServiceClusterSupportEvent ¶
type ContainerServiceClusterSupportEvent struct {
KubernetesVersion string `json:"kubernetesVersion"`
}
ContainerServiceClusterSupportEvent represents the commonality for support ending and support ended events.
type ContainerServiceEvent ¶
type ContainerServiceEvent interface { ContainerServiceNewKubernetesVersionAvailableEvent | ContainerServiceClusterSupportEndingEvent | ContainerServiceClusterSupportEndedEvent | ContainerServiceNodePoolRollingStartedEvent | ContainerServiceNodePoolRollingSucceededEvent | ContainerServiceNodePoolRollingFailedEvent fmt.Stringer }
ContainerServiceEvent is the constraint set of all possible events.
type ContainerServiceNewKubernetesVersionAvailableEvent ¶
type ContainerServiceNewKubernetesVersionAvailableEvent struct { // LatestSupportedKubernetesVersion is the latest supported Kubernetes version. LatestSupportedKubernetesVersion string `json:"latestSupportedKubernetesVersion"` // LatestStableKubernetesVersion is the latest stable Kubernetes version. LatestStableKubernetesVersion string `json:"latestStableKubernetesVersion"` // LowestMinorKubernetesVersion is the lowest minor Kubernetes version. LowestMinorKubernetesVersion string `json:"lowestMinorKubernetesVersion"` // LatestPreviewKubernetesVersion is the latest preview Kubernetes version. LatestPreviewKubernetesVersion string `json:"latestPreviewKubernetesVersion"` }
ContainerServiceNewKubernetesVersionAvailableEvent is the event that is sent by Azure Kubernetes Service when a new Kubernetes version is available in the CloudEvent's data field.
func (ContainerServiceNewKubernetesVersionAvailableEvent) String ¶
func (e ContainerServiceNewKubernetesVersionAvailableEvent) String() string
String returns a string representation of the ContainerServiceNewKubernetesVersionAvailableEvent.
type ContainerServiceNodePoolRollingFailedEvent ¶
type ContainerServiceNodePoolRollingFailedEvent struct {
ContainerServiceClusterRollingEvent
}
ContainerServiceNodePoolRollingFailedEvent is the event sent when a node pool rolling upgrade has failed.
func (ContainerServiceNodePoolRollingFailedEvent) String ¶
func (e ContainerServiceNodePoolRollingFailedEvent) String() string
String returns a string representation of the ContainerServiceNodePoolRollingFailedEvent.
type ContainerServiceNodePoolRollingStartedEvent ¶
type ContainerServiceNodePoolRollingStartedEvent struct {
ContainerServiceClusterRollingEvent
}
ContainerServiceNodePoolRollingStartedEvent is the event sent when a node pool rolling upgrade has started.
func (ContainerServiceNodePoolRollingStartedEvent) String ¶
func (e ContainerServiceNodePoolRollingStartedEvent) String() string
String returns a string representation of the ContainerServiceNodePoolRollingStartedEvent.
type ContainerServiceNodePoolRollingSucceededEvent ¶
type ContainerServiceNodePoolRollingSucceededEvent struct {
ContainerServiceClusterRollingEvent
}
ContainerServiceNodePoolRollingSucceededEvent is the event sent when a node pool rolling upgrade has succeeded.
func (ContainerServiceNodePoolRollingSucceededEvent) String ¶
func (e ContainerServiceNodePoolRollingSucceededEvent) String() string
String returns a string representation of the ContainerServiceNodePoolRollingSucceededEvent.
type MessageBuilder ¶
type MessageBuilder[T ContainerServiceEvent] struct { // contains filtered or unexported fields }
MessageBuilder builds messages for a specific Azure Event Grid event type.
func NewMessageBuilder ¶
func NewMessageBuilder[T ContainerServiceEvent](filename string) MessageBuilder[T]
NewMessageBuilder creates a new MessageBuilder with the given template filename.
type Options ¶
type Options func(options *options) error
Options represents a functional option for the Publisher.
func WithEmail ¶
WithEmail configures the Publisher to use a specific email recipient. This is required when using SendGrid or SMTP.
func WithLogging ¶
func WithLogging() Options
WithLogging configures the Publisher to output messages as structured logs.
func WithPublisherFunc ¶
func WithPublisherFunc(fn PublisherFunc) Options
WithPublisherFunc configures the Publisher to use a custom PublisherFunc.
func WithSendgrid ¶
WithSendgrid configures the Publisher to send messages via SendGrid.
type Publisher ¶
type Publisher struct {
// contains filtered or unexported fields
}
Publisher is a message publisher.
func NewPublisher ¶
NewPublisher creates a new Publisher with the given options.
type PublisherFunc ¶
PublisherFunc is a function that publishes a message.