Documentation ¶
Index ¶
- Variables
- type Filter
- type FilterGroup
- type FilterMode
- type FilterOperator
- type Option
- func WithAfter(after string) Option
- func WithCategory(category string) Option
- func WithConfidences(confidences []int) Option
- func WithElementWithTargetTypes(elementWithTargetTypes []string) Option
- func WithEndDate(endDate *time.Time) Option
- func WithFilters(filters FilterGroup) Option
- func WithFirst(first int) Option
- func WithFirstSeenStart(firstSeenStart *time.Time) Option
- func WithFirstSeenStop(firstSeenStop *time.Time) Option
- func WithFromIDList(fromIDList []string) Option
- func WithFromOrToIDList(fromOrToIDList []string) Option
- func WithFromRole(fromRole string) Option
- func WithFromTypes(fromTypes []string) Option
- func WithIncludeParents(includeParents bool) Option
- func WithLastSeenStart(lastSeenStart *time.Time) Option
- func WithLastSeenStop(lastSeenStop *time.Time) Option
- func WithOrderBy(orderBy string) Option
- func WithOrderMode(orderMode OrderingMode) Option
- func WithRelationshipType(relationshipType []string) Option
- func WithSearch(search string) Option
- func WithStartDate(startDate *time.Time) Option
- func WithStartTimeStart(startTimeStart *time.Time) Option
- func WithStartTimeStop(startTimeStop *time.Time) Option
- func WithStix(stix bool) Option
- func WithStopTimeStart(stopTimeStart *time.Time) Option
- func WithStopTimeStop(stopTimeStop *time.Time) Option
- func WithToIDList(toIDList []string) Option
- func WithToRole(toRole string) Option
- func WithToStix(toStix bool) Option
- func WithToTypes(toTypes []string) Option
- func WithType(type_ string) Option
- func WithTypes(types []string) Option
- type OrderingMode
- type QueryVars
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Filter ¶
type Filter struct { Key []string `json:"key"` Values []any `json:"values"` Operator FilterOperator `json:"operator"` Mode FilterMode `json:"mode"` }
func (Filter) MarshalJSON ¶
MarshalJSON checks for Filter missing content and returns its json representation.
type FilterGroup ¶
type FilterGroup struct { Mode FilterMode `json:"mode"` Filters []Filter `json:"filters"` FilterGroups []FilterGroup `json:"filterGroups"` }
func (FilterGroup) IsValid ¶
func (filterGroup FilterGroup) IsValid() error
IsValid returns any error related to missing FilterGroup content.
func (FilterGroup) MarshalJSON ¶
func (filterGroup FilterGroup) MarshalJSON() ([]byte, error)
MarshalJSON checks for FilterGroup missing content and returns its json representation.
func (FilterGroup) ToGraphQL ¶
func (filterGroup FilterGroup) ToGraphQL() (string, error)
ToGraphQL returns the appropriate representation of a FilterGroup for direct use in a 'customAttributes' field.
type FilterMode ¶
type FilterMode string
FilterMode defines the various filter combination modes available.
const ( FilterModeAnd FilterMode = "and" FilterModeOr FilterMode = "or" )
type FilterOperator ¶
type FilterOperator string
FilterOperator defines the various filtering operators available.
const ( FilterOperatorEq FilterOperator = "eq" FilterOperatorNotEq FilterOperator = "not_eq" FilterOperatorLt FilterOperator = "lt" FilterOperatorLte FilterOperator = "lte" FilterOperatorGt FilterOperator = "gt" FilterOperatorGte FilterOperator = "gte" FilterOperatorMatch FilterOperator = "match" FilterOperatorWildcard FilterOperator = "wildcard" FilterOperatorContains FilterOperator = "contains" FilterOperatorNotContains FilterOperator = "not_contains" FilterOperatorEndsWith FilterOperator = "ends_with" FilterOperatorNotEndsWith FilterOperator = "not_ends_with" FilterOperatorStartsWith FilterOperator = "starts_with" FilterOperatorNotStartsWith FilterOperator = "not_starts_with" FilterOperatorScript FilterOperator = "script" FilterOperatorNil FilterOperator = "nil" FilterOperatorNotNil FilterOperator = "not_nil" FilterOperatorSearch FilterOperator = "search" )
type Option ¶
type Option func(*QueryVars)
Option is a function that configures a QueryVars object.
func WithCategory ¶
func WithConfidences ¶
func WithEndDate ¶
func WithFilters ¶
func WithFilters(filters FilterGroup) Option
func WithFirstSeenStart ¶
func WithFirstSeenStop ¶
func WithFromIDList ¶
func WithFromOrToIDList ¶
func WithFromRole ¶
func WithFromTypes ¶
func WithIncludeParents ¶
func WithLastSeenStart ¶
func WithLastSeenStop ¶
func WithOrderBy ¶
func WithOrderMode ¶
func WithOrderMode(orderMode OrderingMode) Option
func WithRelationshipType ¶
func WithSearch ¶
func WithStartDate ¶
func WithStartTimeStart ¶
func WithStartTimeStop ¶
func WithStopTimeStart ¶
func WithStopTimeStop ¶
func WithToIDList ¶
func WithToRole ¶
func WithToStix ¶
func WithToTypes ¶
type OrderingMode ¶
type OrderingMode string
OrderingMode defines the various ordering modes available when retrieving multiple entities.
const ( OrderModeAsc OrderingMode = "asc" OrderModeDesc OrderingMode = "desc" )
type QueryVars ¶
type QueryVars struct { Filters FilterGroup `json:"filters"` Search string `json:"search,omitempty"` First int `json:"first,omitempty"` // Number of entities per page After string `json:"after,omitempty"` // EndCursor of previous page OrderBy string `json:"orderBy,omitempty"` // Specific to each entity OrderMode OrderingMode `json:"orderMode"` Category string `json:"category,omitempty"` Confidences []int `json:"confidences,omitempty"` ElementWithTargetTypes []string `json:"elementWithTargetTypes,omitempty"` EndDate *time.Time `json:"endDate,omitempty"` FirstSeenStart *time.Time `json:"firstSeenStart,omitempty"` FirstSeenStop *time.Time `json:"firstSeenStop,omitempty"` FromIDList []string `json:"fromId,omitempty"` FromOrToIDList []string `json:"fromOrToId,omitempty"` FromRole string `json:"fromRole,omitempty"` FromTypes []string `json:"fromTypes,omitempty"` IncludeParents bool `json:"includeParents,omitempty"` LastSeenStart *time.Time `json:"lastSeenStart,omitempty"` LastSeenStop *time.Time `json:"lastSeenStop,omitempty"` RelationshipType []string `json:"relationship_type,omitempty"` StartDate *time.Time `json:"startDate,omitempty"` StartTimeStart *time.Time `json:"startTimeStart,omitempty"` StartTimeStop *time.Time `json:"startTimeStop,omitempty"` Stix bool `json:"stix,omitempty"` StopTimeStart *time.Time `json:"stopTimeStart,omitempty"` StopTimeStop *time.Time `json:"stopTimeStop,omitempty"` ToIDList []string `json:"toId,omitempty"` ToRole string `json:"toRole,omitempty"` ToStix bool `json:"toStix,omitempty"` ToTypes []string `json:"toTypes,omitempty"` Type string `json:"type,omitempty"` Types []string `json:"types,omitempty"` }
QueryVars is a list of parameters to configure a GraphQL List query. Configuration should be made via Option functions.
func NewQueryVars ¶
func NewQueryVars() *QueryVars
NewQueryVars returns a QueryVars instance with default values applied.