format code struct and comments

This commit is contained in:
Xingcai Zhang 2017-11-10 22:24:40 +08:00
parent 98d60cc0d2
commit e4db35f630
1 changed files with 11 additions and 11 deletions

View File

@ -100,13 +100,13 @@ We'd like to propose following structure in Events object in the new events API
```golang ```golang
type Event struct { type Event struct {
// <type and object metadata> // <type and object metadata>
// Time when this Event was first observed. // Time when this Event was first observed.
EventTime metav1.MicroTime EventTime metav1.MicroTime
// Data about the Event series this event represents or nil if it's // Data about the Event series this event represents or nil if it's
// a singleton Event. // a singleton Event.
// +optional // +optional
Series *EventSeries Series *EventSeries
@ -123,7 +123,7 @@ type Event struct {
Reason string Reason string
// The object this Event is “about”. In most cases it's the object that the // The object this Event is “about”. In most cases it's the object that the
// given controller implements. // given controller implements.
// +optional // +optional
Regarding ObjectReference Regarding ObjectReference
@ -132,24 +132,24 @@ type Event struct {
Related *ObjectReference Related *ObjectReference
// Human readable description of the Event. Possibly discarded when and // Human readable description of the Event. Possibly discarded when and
// Event series is being deduplicated. // Event series is being deduplicated.
// +optional // +optional
Note string Note string
// Type of this event (Normal, Warning), new types could be added in the // Type of this event (Normal, Warning), new types could be added in the
// future. // future.
// +optional // +optional
Type string Type string
} }
type EventSeries struct { type EventSeries struct {
Count int32 Count int32
LastObservedTime MicroTime LastObservedTime MicroTime
State EventSeriesState State EventSeriesState
} }
const ( const (
EventSeriesStateOngoing = "Ongoing" EventSeriesStateOngoing = "Ongoing"
EventSeriesStateFinished = "Finished" EventSeriesStateFinished = "Finished"
EventSeriesStateUnknown = "Unknown" EventSeriesStateUnknown = "Unknown"
) )