Documentation ¶
Index ¶
- Constants
- Variables
- func ClearCache()
- func FetchAndCacheGVRs(clientset *kubernetes.Clientset) error
- func FindGVR(clientset *kubernetes.Clientset, resourceId string) (schema.GroupVersionResource, error)
- func PrintCache()
- type ASTNode
- type Clause
- type ComparisonType
- type CreateClause
- type DefaultProp
- type DeleteClause
- type Direction
- type Expression
- type JSONPathValue
- type JSONPathValueList
- type KeyValuePair
- type Lexer
- type MatchClause
- type MatchCriterion
- type NodePattern
- type NodeRelationshipList
- type Properties
- type Property
- type QueryExecutor
- type Relationship
- type RelationshipRule
- type RelationshipType
- type ResourceProperties
- type ResourceRelationship
- type ReturnClause
- type SetClause
- type Token
Constants ¶
View Source
const BOOLEAN = 57349
View Source
const COLON = 57354
View Source
const COMMA = 57364
View Source
const CREATE = 57359
View Source
const DELETE = 57358
View Source
const EOF = 57361
View Source
const EQUALS = 57365
View Source
const IDENT = 57346
View Source
const INT = 57348
View Source
const JSONDATA = 57351
View Source
const JSONPATH = 57347
View Source
const LBRACE = 57362
View Source
const LPAREN = 57352
View Source
const MATCH = 57355
View Source
const RBRACE = 57363
View Source
const REL_BEGINPROPS_LEFT = 57370
View Source
const REL_BEGINPROPS_NONE = 57371
View Source
const REL_ENDPROPS_NONE = 57373
View Source
const REL_ENDPROPS_RIGHT = 57372
View Source
const REL_NOPROPS_BOTH = 57368
View Source
const REL_NOPROPS_LEFT = 57367
View Source
const REL_NOPROPS_NONE = 57369
View Source
const REL_NOPROPS_RIGHT = 57366
View Source
const RETURN = 57360
View Source
const RPAREN = 57353
View Source
const SET = 57357
View Source
const STRING = 57350
View Source
const WHERE = 57356
Variables ¶
View Source
var AllNamespaces bool
View Source
var GvrCache = make(map[string]schema.GroupVersionResource)
View Source
var GvrCacheMutex sync.RWMutex
View Source
var LogLevel string
View Source
var Namespace string
Functions ¶
func ClearCache ¶ added in v0.4.2
func ClearCache()
func FetchAndCacheGVRs ¶
func FetchAndCacheGVRs(clientset *kubernetes.Clientset) error
func FindGVR ¶
func FindGVR(clientset *kubernetes.Clientset, resourceId string) (schema.GroupVersionResource, error)
func PrintCache ¶ added in v0.4.2
func PrintCache()
Types ¶
type ASTNode ¶
func NewASTNode ¶
type ComparisonType ¶
type ComparisonType string
const ( ExactMatch ComparisonType = "ExactMatch" OwnerRefMatch ComparisonType = "OwnerRefMatch" ContainsAll ComparisonType = "ContainsAll" )
type CreateClause ¶
type CreateClause struct { Nodes []*NodePattern Relationships []*Relationship }
type DefaultProp ¶
type DeleteClause ¶
type DeleteClause struct {
NodeIds []string
}
type Expression ¶
type Expression struct {
Clauses []Clause
}
func ParseQuery ¶
func ParseQuery(query string) (*Expression, error)
type JSONPathValue ¶
type JSONPathValue struct {
Value interface{}
}
type JSONPathValueList ¶
type JSONPathValueList struct {
JSONPathValues []*JSONPathValue
}
type KeyValuePair ¶
type KeyValuePair struct { Key string Value interface{} }
type MatchClause ¶
type MatchClause struct { Nodes []*NodePattern Relationships []*Relationship ExtraFilters []*KeyValuePair }
type MatchCriterion ¶
type MatchCriterion struct { FieldA string FieldB string ComparisonType ComparisonType DefaultProps []DefaultProp }
type NodePattern ¶
type NodePattern struct {
ResourceProperties *ResourceProperties
}
type NodeRelationshipList ¶
type NodeRelationshipList struct { Nodes []*NodePattern Relationships []*Relationship }
type Properties ¶
type Properties struct {
PropertyList []*Property
}
type Property ¶
type Property struct { Key string // Value is string int or bool Value interface{} }
type QueryExecutor ¶
type QueryExecutor struct { Clientset *kubernetes.Clientset DynamicClient dynamic.Interface // contains filtered or unexported fields }
func GetQueryExecutorInstance ¶
func GetQueryExecutorInstance() *QueryExecutor
func NewQueryExecutor ¶
func NewQueryExecutor() (*QueryExecutor, error)
func (*QueryExecutor) Execute ¶
func (q *QueryExecutor) Execute(ast *Expression) (interface{}, error)
type Relationship ¶
type Relationship struct { ResourceProperties *ResourceProperties Direction Direction LeftNode *NodePattern RightNode *NodePattern }
type RelationshipRule ¶
type RelationshipRule struct { KindA string KindB string Relationship RelationshipType // Currently only supports one match criterion but can be extended to support multiple MatchCriteria []MatchCriterion }
type RelationshipType ¶
type RelationshipType string
const ( // deployments to replicasets / replicasets to pods / statefulsets to pods / daemonsets to pods etc. DeploymentOwnReplicaset RelationshipType = "DEPLOYMENT_OWN_REPLICASET" ReplicasetOwnPod RelationshipType = "REPLICASET_OWN_POD" StatefulsetOwnPod RelationshipType = "STATEFULSET_OWN_POD" DaemonsetOwnPod RelationshipType = "DAEMONSET_OWN_POD" JobOwnPod RelationshipType = "JOB_OWN_POD" // services to pods / deployments / statefulsets / daemonsets / replicasets ServiceExposePod RelationshipType = "SERVICE_EXPOSE_POD" ServiceExposeDeployment RelationshipType = "SERVICE_EXPOSE_DEPLOYMENT" ServiceExposeStatefulset RelationshipType = "SERVICE_EXPOSE_STATEFULSET" ServiceExposeDaemonset RelationshipType = "SERVICE_EXPOSE_DAEMONSET" ServiceExposeReplicaset RelationshipType = "SERVICE_EXPOSE_REPLICASET" // This is for configMaps, Volumes, Secrets in pods Mount RelationshipType = "MOUNT" // ingresses to services Route RelationshipType = "ROUTE" )
type ResourceProperties ¶
type ResourceProperties struct { Name string Kind string Properties *Properties JsonData string }
type ResourceRelationship ¶
type ResourceRelationship struct { FromKind string ToKind string Type RelationshipType }
type ReturnClause ¶
type ReturnClause struct {
JsonPaths []string
}
type SetClause ¶
type SetClause struct {
KeyValuePairs []*KeyValuePair
}
Click to show internal directories.
Click to hide internal directories.