Documentation ¶
Index ¶
- Variables
- func ConvertAPIKeyToBackendKey(parameter string) string
- func FormatFilters(filters []string) (map[string][]string, error)
- func MillisecondsToTime(dateTime int64) time.Time
- func StringArrayToInterfaceArray(array []string) []interface{}
- func StringDateRangeToTime(date string) (time.Time, bool)
- func ValidateDateRange(start string, end string) bool
- func ValidateMillisecondDateRange(start int64, end int64) (time.Time, time.Time, error)
- func ValidatePagingCursorTime(before int64, after int64, cursor string, end int64) (time.Time, bool, error)
- type ActionLine
- type EntryCount
- type FeedConsumerNetwork
- type FeedConsumerNetworkQuery
- type FeedEntry
- type FeedQuery
- type FeedSummary
- type FeedSummaryQuery
- type Producer
- type Timeslot
Constants ¶
This section is empty.
Variables ¶
var ( ProjectTag = "projects" ProducerTypeTag = "producer_object_type" ChefServerProducerTypeTag = "chef_server" ChefServerFieldTag = "chef_infra_server" ChefOrganizationFieldTag = "chef_organization" ParentNameFieldTag = "parent_name" ParentIDFieldTag = "parent_id" )
Functions ¶
func ConvertAPIKeyToBackendKey ¶
ConvertAPIKeyToBackendKey Transforms the keys used for the API to the keys used in the backend (Elasticsearch).
func FormatFilters ¶
FormatFilters Will receive an array of filters and will format them into a map of strings To be used on filtering Events
Example:
[ "environment:adios", "environment:hola", "cookbook:awesome", "roles:lalala", ]
The returned filters would look like:
map[string][]string [
"environment": ["adios","hola"], "cookbook": ["awesome"], "roles": ["lalala"],
]
func MillisecondsToTime ¶
func StringArrayToInterfaceArray ¶
func StringArrayToInterfaceArray(array []string) []interface{}
func StringDateRangeToTime ¶
StringDateRangeToTime will transform a Date Range (start/end) to a Time type it verifies that it has a specific layout
The format we want is: YYYY-MM-DD
func ValidateDateRange ¶
ValidateDateRange will validate that the provided start & end date are valid. That means they both have to have the right format and the start time must be less than or equal to the end time
NOTE: If start or end are empty strings ("") that's consider an ok "empty" parameter
func ValidateMillisecondDateRange ¶
ValidateMillisecondDateRange will validate that the provided start & end date are valid. That means the start time must be less than or equal to the end time
NOTE: If start or end are 0 that's considered an ok "empty" parameter
Types ¶
type ActionLine ¶
a ActionLine feed timeline has multiple lines, one per action (verb)
type EntryCount ¶
each timeslot can have multiple categories of entries (profile, scan job, etc.), each with its own count
type FeedConsumerNetwork ¶
type FeedConsumerNetwork struct { ID string `json:"id"` ProducerIDs []string `json:"producer_ids"` Producers []Producer `json:"producer"` Created string `json:"created"` }
func (*FeedConsumerNetwork) ToJSON ¶
func (network *FeedConsumerNetwork) ToJSON() ([]byte, error)
func (*FeedConsumerNetwork) ToString ¶
func (network *FeedConsumerNetwork) ToString() string
type FeedConsumerNetworkQuery ¶
type FeedConsumerNetworkQuery struct {
UserID string
}
type FeedEntry ¶
type FeedEntry struct { ID string `json:"entity_uuid"` ProducerID string `json:"producer_id"` ProducerName string `json:"producer_name"` ProducerObjectType string `json:"producer_object_type"` ProducerTags []string `json:"producer_tags"` FeedType string `json:"feed_type"` // e.g., event feed, msg feed, notifications/alerts, audit, other activity feed EventType string `json:"event_type"` Tags []string `json:"tags"` Published time.Time `json:"pub_timestamp"` ActorID string `json:"actor_id"` ActorName string `json:"actor_name"` ActorObjectType string `json:"actor_object_type"` Verb string `json:"verb"` ObjectID string `json:"object_id"` ObjectName string `json:"object_name"` ObjectObjectType string `json:"object_object_type"` TargetID string `json:"target_id"` TargetName string `json:"target_name"` TargetObjectType string `json:"target_object_type"` Created time.Time `json:"created"` Projects []string `json:"projects"` ChefOrganization string `json:"chef_organization"` ChefInfraServer string `json:"chef_infra_server"` ParentName string `json:"parent_name"` ParentID string `json:"parent_id"` }