Documentation ¶
Overview ¶
Defines a common set of filters that can be applied in queries for supported databases types.
Index ¶
- Constants
- Variables
- func GetExecutionName(seed int64) string
- func GetInvalidRepeatedValueFilterErr(expression FilterExpression) error
- func GetInvalidSingleValueFilterErr(expression FilterExpression) error
- func GetNamespaceName(mapping NamespaceMapping, project, domain string) string
- func GetUnrecognizedFilterFunctionErr(function string) error
- func GetUnsupportedFilterExpressionErr(expression FilterExpression) error
- func IsExecutionTerminal(phase core.WorkflowExecution_Phase) bool
- func IsNodeExecutionTerminal(phase core.NodeExecution_Phase) bool
- func IsTaskExecutionTerminal(phase core.TaskExecution_Phase) bool
- type CloudProvider
- type Entity
- type FilterExpression
- type GormQueryExpr
- type InlineFilter
- func NewInlineFilter(entity Entity, function string, field string, value interface{}) (InlineFilter, error)
- func NewRepeatedValueFilter(entity Entity, function FilterExpression, field string, ...) (InlineFilter, error)
- func NewSingleValueFilter(entity Entity, function FilterExpression, field string, value interface{}) (InlineFilter, error)
- func NewWithDefaultValueFilter(defaultValue interface{}, filter InlineFilter) (InlineFilter, error)
- type MapFilter
- type NamespaceMapping
- type SortParameter
Constants ¶
View Source
const ( AuditFieldsContextKey contextutils.Key = "audit_fields" PrincipalContextKey contextutils.Key = "principal" )
View Source
const ( Execution = "e" LaunchPlan = "l" NodeExecution = "ne" NodeExecutionEvent = "nee" Task = "t" TaskExecution = "te" Workflow = "w" NamedEntityMetadata = "nem" )
View Source
const AllowedExecutionIDStartCharStr = "abcdefghijklmnopqrstuvwxyz"
In kubernetes, resource names must comply with this regex: '[a-z]([-a-z0-9]*[a-z0-9])?'
View Source
const AllowedExecutionIDStr = "abcdefghijklmnopqrstuvwxyz1234567890"
View Source
const EqualExpression = "eq"
View Source
const ExecutionIDLength = 10
Variables ¶
View Source
var AllowedExecutionIDChars = []rune(AllowedExecutionIDStr)
View Source
var AllowedExecutionIDStartChars = []rune(AllowedExecutionIDStartCharStr)
View Source
var ResourceTypeToEntity = map[core.ResourceType]Entity{ core.ResourceType_LAUNCH_PLAN: LaunchPlan, core.ResourceType_TASK: Task, core.ResourceType_WORKFLOW: Workflow, }
ResourceTypeToEntity maps a resource type to an entity suitable for use with Database filters
View Source
var RuntimeTypeKey = contextutils.Key("runtime_type")
View Source
var RuntimeVersionKey = contextutils.Key("runtime_version")
Functions ¶
func GetExecutionName ¶
func GetInvalidRepeatedValueFilterErr ¶
func GetInvalidRepeatedValueFilterErr(expression FilterExpression) error
func GetInvalidSingleValueFilterErr ¶
func GetInvalidSingleValueFilterErr(expression FilterExpression) error
func GetNamespaceName ¶ added in v0.1.3
func GetNamespaceName(mapping NamespaceMapping, project, domain string) string
GetNamespaceName returns kubernetes namespace name
func GetUnrecognizedFilterFunctionErr ¶ added in v0.1.4
func GetUnsupportedFilterExpressionErr ¶
func GetUnsupportedFilterExpressionErr(expression FilterExpression) error
func IsExecutionTerminal ¶
func IsExecutionTerminal(phase core.WorkflowExecution_Phase) bool
func IsNodeExecutionTerminal ¶
func IsNodeExecutionTerminal(phase core.NodeExecution_Phase) bool
func IsTaskExecutionTerminal ¶
func IsTaskExecutionTerminal(phase core.TaskExecution_Phase) bool
Types ¶
type CloudProvider ¶
type CloudProvider = string
const ( AWS CloudProvider = "aws" GCP CloudProvider = "gcp" Local CloudProvider = "local" )
type FilterExpression ¶
type FilterExpression int
const ( Contains FilterExpression = iota GreaterThan GreaterThanOrEqual LessThan LessThanOrEqual Equal NotEqual ValueIn )
Complete set of filters available for database queries.
type GormQueryExpr ¶
type GormQueryExpr struct { Query string Args interface{} }
Container for arguments necessary to issue a GORM query.
type InlineFilter ¶
type InlineFilter interface { // Returns the entity for which this filter should be applied. GetEntity() Entity // Returns the column filtered on. GetField() string // Generates fields necessary to add a filter to a gorm database query. GetGormQueryExpr() (GormQueryExpr, error) // Generates fields necessary to add a filter on a gorm database join query. GetGormJoinTableQueryExpr(tableName string) (GormQueryExpr, error) }
Interface for a single filter expression.
func NewInlineFilter ¶
func NewInlineFilter(entity Entity, function string, field string, value interface{}) (InlineFilter, error)
func NewRepeatedValueFilter ¶
func NewRepeatedValueFilter(entity Entity, function FilterExpression, field string, repeatedValue interface{}) (InlineFilter, error)
Returns a filter which uses a repeated argument value.
func NewSingleValueFilter ¶
func NewSingleValueFilter(entity Entity, function FilterExpression, field string, value interface{}) (InlineFilter, error)
Returns a filter which uses a single argument value.
func NewWithDefaultValueFilter ¶ added in v0.2.5
func NewWithDefaultValueFilter(defaultValue interface{}, filter InlineFilter) (InlineFilter, error)
type MapFilter ¶
type MapFilter interface {
GetFilter() map[string]interface{}
}
Interface for a map filter expression.
func NewMapFilter ¶
type NamespaceMapping ¶ added in v0.1.3
type NamespaceMapping int
const ( ProjectDomain NamespaceMapping = iota Domain NamespaceMapping = iota )
type SortParameter ¶
type SortParameter interface {
GetGormOrderExpr() string
}
func NewSortParameter ¶
func NewSortParameter(sort admin.Sort) (SortParameter, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.