Documentation ¶
Index ¶
- type AccountStatusUpdated
- type AccountStatusUpdatedData
- type Actor
- type BaseBody
- func (b *BaseBody) Actor() *Actor
- func (b *BaseBody) CreatedAt() *strfmt.DateTime
- func (b *BaseBody) IPAddress() string
- func (b *BaseBody) RefID() manifold.ID
- func (b *BaseBody) Scope() *Scope
- func (b *BaseBody) SetActor(a *Actor)
- func (b *BaseBody) SetCreatedAt(t *strfmt.DateTime)
- func (b *BaseBody) SetIPAddress(ip string)
- func (b *BaseBody) SetRefID(id manifold.ID)
- func (b *BaseBody) SetScope(s *Scope)
- func (b *BaseBody) SetSource(s *string)
- func (b *BaseBody) SetType(s string)
- func (b *BaseBody) Source() *string
- func (b *BaseBody) Type() Type
- func (b *BaseBody) Validate(v interface{}) error
- type Body
- type Error
- type Event
- type Operation
- type OperationDeprovisioned
- type OperationDeprovisionedData
- type OperationError
- type OperationFailed
- type OperationFailedData
- type OperationProvisioned
- type OperationProvisionedData
- type OperationResized
- type OperationResizedData
- type Plan
- type Product
- type Project
- type Provider
- type Region
- type Resource
- type ResourceMeasuresAdded
- type ResourceMeasuresAddedData
- type ResourceMeasuresFailed
- type ResourceMeasuresFailedData
- type ResourceOwnerChanged
- type ResourceOwnerChangedData
- type ResourceProjectChanged
- type ResourceProjectChangedData
- type Scope
- type SourceType
- type Team
- type Type
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountStatusUpdated ¶ added in v0.9.5
type AccountStatusUpdated struct { BaseBody Data *AccountStatusUpdatedData `json:"data"` }
AccountStatusUpdated represents an account state change
type AccountStatusUpdatedData ¶ added in v0.9.5
type AccountStatusUpdatedData struct { Reason string `json:"reason,omitempty"` OldState string `json:"old_state"` NewState string `json:"new_state"` }
AccountStatusUpdatedData holds the event specific data.
type Actor ¶
type Actor struct { ID manifold.ID `json:"id"` Name string `json:"name"` Email string `json:"email,omitempty"` }
Actor represents a simplified version of either a user or a team.
type BaseBody ¶
type BaseBody struct { EventType Type `json:"type"` StructActor *Actor `json:"actor,omitempty"` StructScope *Scope `json:"scope,omitempty"` StructRefID manifold.ID `json:"ref_id"` StructCreatedAt time.Time `json:"created_at"` StructSource SourceType `json:"source"` StructIPAddress string `json:"ip_address"` }
BaseBody contains data associated with all events.
func (*BaseBody) SetCreatedAt ¶
SetCreatedAt sets the body's CreatedAt
func (*BaseBody) SetIPAddress ¶
SetIPAddress sets the body's IPAddress
func (*BaseBody) SetRefID ¶
func (b *BaseBody) SetRefID(id manifold.ID)
SetRefID sets the body's RefID
type Body ¶
type Body interface { Validate(interface{}) error Type() Type SetType(string) Actor() *Actor SetActor(*Actor) Scope() *Scope SetScope(*Scope) RefID() manifold.ID SetRefID(manifold.ID) CreatedAt() *strfmt.DateTime SetCreatedAt(*strfmt.DateTime) Source() *string SetSource(*string) IPAddress() string SetIPAddress(string) }
Body represents methods all Events must implement.
type Event ¶
type Event struct { ID manifold.ID `json:"id"` StructType string `json:"type"` StructVersion int `json:"version"` Body Body `json:"body"` }
Event represents meaningful activities performed on the system.
func (*Event) GetID ¶
func (e *Event) GetID() manifold.ID
GetID returns the ID associated with this event
func (*Event) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for an event
type Operation ¶
type Operation struct { ID manifold.ID `json:"id"` Type string `json:"type"` State string `json:"state"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
Operation is a simplified version for events data.
type OperationDeprovisioned ¶
type OperationDeprovisioned struct { BaseBody Data *OperationDeprovisionedData `json:"data"` }
OperationDeprovisioned represents a deprovision operation event.
type OperationDeprovisionedData ¶
type OperationDeprovisionedData struct { Operation Operation `json:"operation"` Source string `json:"source" analytics:"type"` Resource Resource `json:"resource"` Project *Project `json:"project,omitempty"` Provider *Provider `json:"provider,omitempty"` Product *Product `json:"product,omitempty"` Plan *Plan `json:"plan,omitempty"` Region *Region `json:"region,omitempty"` }
OperationDeprovisionedData holds the event specific data.
type OperationError ¶
type OperationError struct { Message string `json:"message"` Code int `json:"code"` Attempt int `json:"count"` CreatedAt time.Time `json:"created_at"` }
OperationError represents an error message.
func (OperationError) Validate ¶
func (OperationError) Validate(v interface{}) error
Validate returns whether or not the given OperationError is valid
type OperationFailed ¶
type OperationFailed struct { BaseBody Data *OperationFailedData `json:"data"` }
OperationFailed represents a resize operation event.
type OperationFailedData ¶
type OperationFailedData struct { Operation Operation `json:"operation"` Resource *Resource `json:"resource,omitempty"` Project *Project `json:"project,omitempty"` Provider *Provider `json:"provider,omitempty"` Product *Product `json:"product,omitempty"` Plan *Plan `json:"plan,omitempty"` Region *Region `json:"region,omitempty"` Error OperationError `json:"error"` }
OperationFailedData holds the event specific data.
type OperationProvisioned ¶
type OperationProvisioned struct { BaseBody Data *OperationProvisionedData `json:"data"` }
OperationProvisioned represents a provision operation event.
type OperationProvisionedData ¶
type OperationProvisionedData struct { Operation Operation `json:"operation"` Source string `json:"source" analytics:"type"` Resource Resource `json:"resource"` Project *Project `json:"project,omitempty"` Provider *Provider `json:"provider,omitempty"` Product *Product `json:"product,omitempty"` Plan *Plan `json:"plan,omitempty"` Region *Region `json:"region,omitempty"` }
OperationProvisionedData holds the event specific data.
type OperationResized ¶
type OperationResized struct { BaseBody Data *OperationResizedData `json:"data"` }
OperationResized represents a resize operation event.
type OperationResizedData ¶
type OperationResizedData struct { Operation Operation `json:"operation"` Source string `json:"source" analytics:"type"` Resource Resource `json:"resource"` Project *Project `json:"project,omitempty"` Provider *Provider `json:"provider,omitempty"` Product *Product `json:"product,omitempty"` OldPlan *Plan `json:"old_plan,omitempty"` NewPlan *Plan `json:"new_plan,omitempty"` Region *Region `json:"region,omitempty"` }
OperationResizedData holds the event specific data.
type Plan ¶
type Plan struct { ID manifold.ID `json:"id" analytics:"plan_id"` Name string `json:"name" analytics:"plan_name"` Cost int `json:"cost" analytics:"plan_cost"` }
Plan is a simplified version for events data.
type Product ¶
type Product struct { ID manifold.ID `json:"id" analytics:"product_id"` Name string `json:"name" analytics:"product_name"` }
Product is a simplified version for events data.
type Project ¶
type Project struct { ID manifold.ID `json:"id" analytics:"project_id"` Name string `json:"name" analytics:"project_name"` }
Project is a simplified version for events data.
type Provider ¶
type Provider struct { ID manifold.ID `json:"id" analytics:"provider_id"` Name string `json:"name" analytics:"provider_name"` }
Provider is a simplified version for events data.
type Region ¶
type Region struct { ID manifold.ID `json:"id" analytics:"region_id"` Name string `json:"name" analytics:"region_name"` Platform string `json:"platform" analytics:"region_platform"` Location string `json:"location" analytics:"region_location"` Priority float64 `json:"priority" analytics:"region_priority"` }
Region is a simplified version for events data.
type Resource ¶
type Resource struct { ID manifold.ID `json:"id" analytics:"resource_id"` Name string `json:"name" analytics:"resource_name"` }
Resource is a simplified version for events data.
type ResourceMeasuresAdded ¶
type ResourceMeasuresAdded struct { BaseBody Data *ResourceMeasuresAddedData `json:"data"` }
ResourceMeasuresAdded represents a change on resource usage.
type ResourceMeasuresAddedData ¶
type ResourceMeasuresAddedData struct { Resource Resource `json:"resource"` Project *Project `json:"project,omitempty"` Provider Provider `json:"provider"` Product Product `json:"product"` Plan Plan `json:"plan"` Region Region `json:"region"` Measures map[string]int64 `json:"measures"` }
ResourceMeasuresAddedData holds the event specific data.
type ResourceMeasuresFailed ¶ added in v0.9.5
type ResourceMeasuresFailed struct { BaseBody Data *ResourceMeasuresFailedData `json:"data"` }
ResourceMeasuresFailed represents a failed change to resource usage.
type ResourceMeasuresFailedData ¶ added in v0.9.5
type ResourceMeasuresFailedData struct { Resource Resource `json:"resource"` Project *Project `json:"project,omitempty"` Provider Provider `json:"provider"` Product Product `json:"product"` Plan Plan `json:"plan"` Region Region `json:"region"` Error Error `json:"error"` }
ResourceMeasuresFailedData holds the event specific data.
type ResourceOwnerChanged ¶ added in v0.9.4
type ResourceOwnerChanged struct { BaseBody Data *ResourceOwnerChangedData `json:"data"` }
ResourceOwnerChanged records a transfer operation event
type ResourceOwnerChangedData ¶ added in v0.9.4
type ResourceOwnerChangedData struct { Operation Operation `json:"operation"` Source string `json:"source" analytics:"type"` Resource Resource `json:"resource"` OldUser *User `json:"old_user,omitempty"` OldTeam *Team `json:"old_team,omitempty"` NewUser *User `json:"new_user,omitempty"` NewTeam *Team `json:"new_team,omitempty"` Plan *Plan `json:"plan,omitempty"` Provider *Provider `json:"provider,omitempty"` Product *Product `json:"product,omitempty"` Project *Project `json:"project,omitempty"` Region *Region `json:"region,omitempty"` }
ResourceOwnerChangedData holds the specific transfer event data
type ResourceProjectChanged ¶ added in v0.9.4
type ResourceProjectChanged struct { BaseBody Data *ResourceProjectChangedData `json:"data"` }
ResourceProjectChanged records a move operation event
type ResourceProjectChangedData ¶ added in v0.9.4
type ResourceProjectChangedData struct { Operation Operation `json:"operation"` Source string `json:"source" analytics:"type"` Resource Resource `json:"resource"` Provider *Provider `json:"provider,omitempty"` Product *Product `json:"product,omitempty"` Plan *Plan `json:"plan,omitempty"` OldProject *Project `json:"old_project,omitempty"` NewProject *Project `json:"new_project,omitempty"` Region *Region `json:"region,omitempty"` }
ResourceProjectChangedData holds the specific move event details
type Scope ¶
type Scope struct { ID manifold.ID `json:"id"` Name string `json:"name"` Email string `json:"email,omitempty"` }
Scope represents a simplified version of either a user or a team.
type SourceType ¶
type SourceType string
SourceType represents where the request came from.
const ( // SourceDashboard is a request coming from the dashboard SourceDashboard SourceType = "dashboard" // SourceCLI is a request coming from the cli SourceCLI SourceType = "cli" // SourceSystem is an internal request SourceSystem SourceType = "system" // SourceProvider is a request from provider SourceProvider SourceType = "provider" )
func (SourceType) Validate ¶ added in v0.9.5
func (s SourceType) Validate(interface{}) error
Validate whether source type is valid
type Team ¶
type Team struct { ID manifold.ID `json:"id"` Name string `json:"name"` }
Team is a simplified version for events data.
type Type ¶
type Type string
Type represents the different types of events.
const ( // TypeOperationProvisioned represents a provision operation TypeOperationProvisioned Type = "operation.provisioned" // TypeOperationDeprovisioned represents a deprovision operation TypeOperationDeprovisioned Type = "operation.deprovisioned" // TypeOperationResized represents a provision operation TypeOperationResized Type = "operation.resized" // TypeResourceProjectChanged represents a move operation TypeResourceProjectChanged Type = "resource.project.changed" // TypeResourceOwnerChanged represents a transfer operation TypeResourceOwnerChanged Type = "resource.owner.changed" // TypeOperationFailed represents a failed operation TypeOperationFailed Type = "operation.failed" // TypeResourceMeasuresAdded represents a change on resource usage TypeResourceMeasuresAdded = "resource.measures.added" // TypeResourceMeasuresFailed represents a failed change to resource usage TypeResourceMeasuresFailed = "resource.measures.failed" // TypeAccountStatusUpdated represents an account state update TypeAccountStatusUpdated = "account.status.updated" )