Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var TypeHandler = map[EventKind]func() interface{}{ AppCreateKind: func() interface{} { return &struct { Metadata AppCreateMetadata `json:"metadata"` }{} }, AppStopKind: func() interface{} { return &struct { Metadata AppStopEvent `json:"metadata"` }{} }, AppDeleteKind: func() interface{} { return &struct { Metadata AppDeleteEvent `json:"metadata"` }{} }, AppUpdateKind: func() interface{} { return &struct { Metadata AppUpdateEvent `json:"metadata"` }{} }, AppSSHKind: func() interface{} { return &struct { Metadata AppSSHEvent `json:"metadata"` }{} }, AppCrashKind: func() interface{} { return &struct { Metadata AppCrashEvent `json:"metadata"` }{} }, }
TypeHandler is our interface for typing the events API with the entity metadata by exploiting the JSON interface.
Functions ¶
This section is empty.
Types ¶
type AppCrashEvent ¶
type AppCreateMetadata ¶
type AppDeleteEvent ¶
type AppDeleteEvent struct {
Recursive bool `json:"recursive"`
}
type AppEntity ¶
type AppEntity struct { Type EventKind `json:"type"` Actor string `json:"actor"` ActorType string `json:"actor_type"` ActorName string `json:"actor_name"` Actee string `json:"actee"` ActeeType string `json:"actee_type"` ActeeName string `json:"actee_name"` Timestamp string `json:"timestamp"` SpaceGUID string `json:"space_guid"` OrganizationGUID string `json:"organization_guid"` }
AppEntity contains the common bits of an entity. It is embedded in AppEntityEnv.
type AppEntityEnv ¶
type AppEntityEnv struct { AppEntity // embed this here, so we don't recurse in (*AppEntityEnv).UnmarshalJSON. Metadata interface{} `json:"metadata"` }
func (*AppEntityEnv) String ¶
func (a *AppEntityEnv) String() string
func (*AppEntityEnv) UnmarshalJSON ¶
func (e *AppEntityEnv) UnmarshalJSON(data []byte) error
type AppEvent ¶
type AppEvent struct { TotalResults int `json:"total_results"` TotalPages int `json:"total_pages"` PrevURL string `json:"prev_url,omitempty"` NextURL string `json:"next_url,omitempty"` Resources []Resource `json:"resources"` }
AppEvent is the top-level object.
type AppSSHEvent ¶
type AppSSHEvent struct {
Index int `json:"index"`
}
type AppStopEvent ¶
type AppStopEvent struct{}
type AppUpdateEvent ¶
type EventKind ¶
type EventKind int
EventKind is the type of auditing event from Cloud Foundry.
func (*EventKind) UnmarshalJSON ¶
UnmarshalJSON maps an event to it's appropriate type so it can be unmarshalled more sanely.
type EventMetadata ¶
type Resource ¶
type Resource struct { Metadata EventMetadata `json:"metadata"` Entity AppEntityEnv `json:"entity"` }
Click to show internal directories.
Click to hide internal directories.