Documentation
¶
Overview ¶
Package dgraphstore provides store implementation with Dgraph
Index ¶
- func ApplySchema(ctx context.Context, dg *dgo.Dgraph) error
- func NewDgraphClient(grpcClient *grpc.ClientConn) *dgo.Dgraph
- func NewGrpcClient(address string, opts []grpc.DialOption) (*grpc.ClientConn, error)
- type Action
- type Constraint
- type DgraphActionStore
- func (d *DgraphActionStore) Add(action *tarianpb.Action) error
- func (d *DgraphActionStore) FindByNamespace(namespace string) ([]*tarianpb.Action, error)
- func (d *DgraphActionStore) GetAll() ([]*tarianpb.Action, error)
- func (d *DgraphActionStore) NamespaceAndNameExist(namespace, name string) (bool, error)
- func (d *DgraphActionStore) RemoveByNamespaceAndName(namespace, name string) error
- type DgraphConfig
- type DgraphConstraintStore
- func (d *DgraphConstraintStore) Add(constraint *tarianpb.Constraint) error
- func (d *DgraphConstraintStore) FindByNamespace(namespace string) ([]*tarianpb.Constraint, error)
- func (d *DgraphConstraintStore) GetAll() ([]*tarianpb.Constraint, error)
- func (d *DgraphConstraintStore) NamespaceAndNameExist(namespace, name string) (bool, error)
- func (d *DgraphConstraintStore) RemoveByNamespaceAndName(namespace, name string) error
- type DgraphEventStore
- func (d *DgraphEventStore) Add(evt *tarianpb.Event) error
- func (d *DgraphEventStore) FindByNamespace(namespace string, limit uint) ([]*tarianpb.Event, error)
- func (d *DgraphEventStore) FindWhereAlertNotSent() ([]*tarianpb.Event, error)
- func (d *DgraphEventStore) GetAll(limit uint) ([]*tarianpb.Event, error)
- func (d *DgraphEventStore) UpdateAlertSent(uid string) error
- func (d *DgraphEventStore) UpsertPod(dgraphPod Pod) (Pod, error)
- type Event
- type Pod
- type Target
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplySchema ¶
func NewDgraphClient ¶
func NewDgraphClient(grpcClient *grpc.ClientConn) *dgo.Dgraph
func NewGrpcClient ¶
func NewGrpcClient(address string, opts []grpc.DialOption) (*grpc.ClientConn, error)
Types ¶
type Action ¶
type Action struct { UID string `json:"uid,omitempty"` DType []string `json:"dgraph.type,omitempty"` Namespace string `json:"action_namespace,omitempty"` Name string `json:"action_name,omitempty"` Selector string `json:"action_selector,omitempty"` OnViolatedProcess bool `json:"action_on_violated_process,omitempty"` OnViolatedFile bool `json:"action_on_violated_file,omitempty"` OnFalcoAlert bool `json:"action_on_falco_alert,omitempty"` FalcoAlertPriority int `json:"action_falco_alert_priority,omitempty"` Action string `json:"action_action,omitempty"` }
type Constraint ¶
type Constraint struct { UID string `json:"uid,omitempty"` DType []string `json:"dgraph.type,omitempty"` Namespace string `json:"constraint_namespace,omitempty"` Name string `json:"constraint_name,omitempty"` Selector string `json:"constraint_selector,omitempty"` AllowedProcesses string `json:"constraint_allowed_processes,omitempty"` AllowedFiles string `json:"constraint_allowed_files,omitempty"` }
type DgraphActionStore ¶
type DgraphActionStore struct {
// contains filtered or unexported fields
}
func NewDgraphActionStore ¶
func NewDgraphActionStore(dgraphClient *dgo.Dgraph) *DgraphActionStore
func (*DgraphActionStore) FindByNamespace ¶
func (d *DgraphActionStore) FindByNamespace(namespace string) ([]*tarianpb.Action, error)
func (*DgraphActionStore) NamespaceAndNameExist ¶
func (d *DgraphActionStore) NamespaceAndNameExist(namespace, name string) (bool, error)
func (*DgraphActionStore) RemoveByNamespaceAndName ¶
func (d *DgraphActionStore) RemoveByNamespaceAndName(namespace, name string) error
type DgraphConfig ¶
type DgraphConstraintStore ¶
type DgraphConstraintStore struct {
// contains filtered or unexported fields
}
func NewDgraphConstraintStore ¶
func NewDgraphConstraintStore(dgraphClient *dgo.Dgraph) *DgraphConstraintStore
func (*DgraphConstraintStore) Add ¶
func (d *DgraphConstraintStore) Add(constraint *tarianpb.Constraint) error
func (*DgraphConstraintStore) FindByNamespace ¶
func (d *DgraphConstraintStore) FindByNamespace(namespace string) ([]*tarianpb.Constraint, error)
func (*DgraphConstraintStore) GetAll ¶
func (d *DgraphConstraintStore) GetAll() ([]*tarianpb.Constraint, error)
func (*DgraphConstraintStore) NamespaceAndNameExist ¶
func (d *DgraphConstraintStore) NamespaceAndNameExist(namespace, name string) (bool, error)
func (*DgraphConstraintStore) RemoveByNamespaceAndName ¶
func (d *DgraphConstraintStore) RemoveByNamespaceAndName(namespace, name string) error
type DgraphEventStore ¶
type DgraphEventStore struct {
// contains filtered or unexported fields
}
func NewDgraphEventStore ¶
func NewDgraphEventStore(dgraphClient *dgo.Dgraph) *DgraphEventStore
func (*DgraphEventStore) FindByNamespace ¶
func (*DgraphEventStore) FindWhereAlertNotSent ¶
func (d *DgraphEventStore) FindWhereAlertNotSent() ([]*tarianpb.Event, error)
func (*DgraphEventStore) GetAll ¶
func (d *DgraphEventStore) GetAll(limit uint) ([]*tarianpb.Event, error)
func (*DgraphEventStore) UpdateAlertSent ¶
func (d *DgraphEventStore) UpdateAlertSent(uid string) error
type Event ¶
type Event struct { UID string `json:"uid,omitempty"` DType []string `json:"dgraph.type,omitempty"` Type string `json:"event_type,omitempty"` EventUID string `json:"event_uid,omitempty"` ClientTimestamp *time.Time `json:"event_client_timestamp,omitempty"` ServerTimestamp *time.Time `json:"event_server_timestamp,omitempty"` AlertSentAt *time.Time `json:"event_alert_sent_at,omitempty"` Targets []Target `json:"targets,omitempty"` }
type Target ¶
type Target struct { UID string `json:"uid,omitempty"` DType []string `json:"dgraph.type,omitempty"` ViolatedProcesses string `json:"target_violated_processes,omitempty"` ViolatedFiles string `json:"target_violated_files,omitempty"` FalcoAlert string `json:"target_falco_alert,omitempty"` Pod *Pod `json:"pod,omitempty"` }
Click to show internal directories.
Click to hide internal directories.