Documentation
¶
Index ¶
Constants ¶
const ( EngineStatusFetching = "fetching" EngineStatusSuccess = "success" EngineStatusFailed = "failed" )
const NotNullValue = "(not null)"
NullValue used in a query, means that the resource should have this field defined
const NullValue = "(null)"
NullValue used in a query, means that the resource should not have this field defined
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EngineStatus ¶ added in v0.0.10
type EngineStatus struct {
ResourceType string `json:"resourceType" gorm:"primaryKey"`
ErrorMessage string `json:"errorMessage"`
Status string `json:"status"`
FetchedAt time.Time `json:"fetchedAt"`
}
func NewEngineStatus ¶ added in v0.0.10
func NewEngineStatus(status string, resource string, err error) EngineStatus
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 (null) 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 (null) 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
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
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 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