Documentation
¶
Index ¶
- Constants
- type Event
- func NewEngineEventEnd(err error) Event
- func NewEngineEventStart() Event
- func NewProviderEventEnd(providerName string, err error) Event
- func NewProviderEventStart(providerName string) Event
- func NewResourceEventEnd(providerName string, resourceType string, err error) Event
- func NewResourceEventStart(providerName string, resourceType string) Event
- type Events
- type Field
- type FieldGroup
- type FieldGroups
- type FieldValue
- type FieldValues
- type Fields
- type Resource
- type ResourceId
- type Resources
- type ResourcesResponse
- type Stats
- type Tag
- type Tags
Constants ¶
const ( //FieldMissing used in a query, means that the resource should not have this field defined FieldMissing = "(missing)" //NullValue used in a query, means that the resource should have this field defined FieldPresent = "(not null)" //CountValueIgnored means that the current value is ignored in the current query CountValueIgnored = "-" //name of the field groups as shown in API FieldGroupCore = "core" FieldGroupTags = "tags" //event status as shown in API EventStatusFetching string = "fetching" EventStatusFailed string = "failed" EventStatusSuccess string = "success" EventStatusLoaded string = "loaded" //event type as shown in API EventTypeEngine string = "engine" EventTypeProvider string = "provider" EventTypeResource string = "resource" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶ added in v0.0.11
type Event struct { Id int64 `json:"-" gorm:"primaryKey;autoIncrement"` RunId string `json:"runId"` Type string `json:"eventType"` Status string `json:"status"` ProviderName string `json:"providerName,omitempty"` ResourceType string `json:"resourceType,omitempty"` Error string `json:"error"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` ChildEvents Events `json:"childEvents" gorm:"-"` }
func NewEngineEventEnd ¶ added in v0.0.11
func NewEngineEventStart ¶ added in v0.0.11
func NewEngineEventStart() Event
func NewProviderEventEnd ¶ added in v0.0.11
func NewProviderEventStart ¶ added in v0.0.11
func NewResourceEventEnd ¶ added in v0.0.11
func NewResourceEventStart ¶ added in v0.0.11
type Field ¶ added in v0.0.10
type Field struct { Name string `json:"name"` Count int `json:"count"` Values FieldValues `json:"values"` }
Field is a searchable attribute on a resource. It also includes the possible values and their respective count.
type FieldGroup ¶ added in v0.0.10
FieldGroup regroups some fields. Ex: "Tags"
type FieldGroups ¶ added in v0.0.10
type FieldGroups []FieldGroup
func (FieldGroups) AddNullValues ¶ added in v0.0.10
func (fgs FieldGroups) AddNullValues() FieldGroups
AddNullValues adds the (missing) value for each Field, it is used by the API to allow filtering on resources without the field. If a field is always defined (ex: type), do not include the (missing) value as it would mean excluding all resources from a query.
func (FieldGroups) FindField ¶ added in v0.0.10
func (fgs FieldGroups) FindField(group string, name string) *Field
func (FieldGroups) FindGroup ¶ added in v0.0.10
func (fgs FieldGroups) FindGroup(group string) *FieldGroup
type FieldValue ¶ added in v0.0.10
FieldValue is a value associated with a field. The count is the number of resources with this field value.
type FieldValues ¶ added in v0.0.10
type FieldValues []*FieldValue
func (FieldValues) Count ¶ added in v0.0.11
func (fv FieldValues) Count() int
func (*FieldValues) Find ¶ added in v0.0.11
func (fv *FieldValues) Find(value string) *FieldValue
type Resource ¶
type Resource struct { Id string `json:"id" gorm:"primaryKey"` Region string `json:"region"` Type string `json:"type"` Tags Tags `json:"tags"` RawData datatypes.JSON `json:"rawData"` UpdatedAt time.Time `json:"updatedAt"` }
TODO store provider info in resource (needed when we can have more than one provider)
func (Resource) MarshalLogObject ¶ added in v0.0.3
func (r Resource) MarshalLogObject(enc zapcore.ObjectEncoder) error
type ResourceId ¶ added in v0.0.10
type ResourceId string
func ResourceIds ¶ added in v0.0.29
func ResourceIds(resources []*Resource) []ResourceId
type Resources ¶ added in v0.0.3
type Resources []*Resource
func (Resources) Clean ¶ added in v0.0.10
Clean removes the generated fields - useful for testing where the same instance is reused
func (Resources) FindById ¶ added in v0.0.3
FindById finds a resource by ID, return nil if not found
func (Resources) Ids ¶ added in v0.0.10
func (rs Resources) Ids() []ResourceId
type ResourcesResponse ¶ added in v0.0.10
type ResourcesResponse struct { Count int `json:"count"` FieldGroups FieldGroups `json:"fieldGroups"` Resources Resources `json:"resources"` }
type Tag ¶
type Tag struct { ResourceId string `json:"-" gorm:"primaryKey"` Key string `json:"key" gorm:"primaryKey"` Value string `json:"value"` }
func (Tag) MarshalLogObject ¶ added in v0.0.3
func (t Tag) MarshalLogObject(enc zapcore.ObjectEncoder) error