metathings_evaluatord_storage

package
v1.1.27 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Evaluator

type Evaluator struct {
	Id        *string
	CreatedAt time.Time
	UpdatedAt time.Time

	Alias       *string `gorm:"column:alias"`
	Description *string `gorm:"column:description"`
	Config      *string `gorm:"column:config"`

	Sources  []*Resource `gorm:"-"`
	Operator *Operator   `gorm:"-"`
}

type EvaluatorSourceMapping

type EvaluatorSourceMapping struct {
	CreatedAt time.Time

	EvaluatorId *string `gorm:"column:evaluator_id"`
	SourceId    *string `gorm:"column:source_id"`
	SourceType  *string `gorm:"column:source_type"`
}

type LuaDescriptor

type LuaDescriptor struct {
	CreatedAt time.Time

	OperatorId *string `gorm:"column:operator_id"`

	Code *string `gorm:"column:code"`
}

type Operator

type Operator struct {
	Id        *string
	CreatedAt time.Time
	UpdatedAt time.Time

	EvaluatorId *string `gorm:"column:evaluator_id"`
	Alias       *string `gorm:"column:alias"`
	Description *string `gorm:"column:description"`

	Driver *string `gorm:"column:driver"`

	LuaDescriptor *LuaDescriptor `gorm:"-"`
}

type Resource

type Resource struct {
	Id   *string
	Type *string
}

type Storage

type Storage interface {
	CreateEvaluator(context.Context, *Evaluator) (*Evaluator, error)
	DeleteEvaluator(ctx context.Context, id string) error
	PatchEvaluator(ctx context.Context, id string, evaluator *Evaluator) (*Evaluator, error)
	GetEvaluator(ctx context.Context, id string) (*Evaluator, error)
	ListEvaluators(context.Context, *Evaluator) ([]*Evaluator, error)
	ListEvaluatorsBySource(context.Context, *Resource) ([]*Evaluator, error)
	AddSourcesToEvaluator(ctx context.Context, evaluator_id string, sources []*Resource) error
	RemoveSourcesFromEvaluator(ctx context.Context, evaluator_id string, sources []*Resource) error

	ExistEvaluator(context.Context, *Evaluator) (bool, error)
	ExistOperator(context.Context, *Operator) (bool, error)
}

func NewStorage

func NewStorage(driver, uri string, args ...interface{}) (Storage, error)

func NewStorageImpl

func NewStorageImpl(driver, uri string, args ...interface{}) (Storage, error)

func NewTracedStorage

func NewTracedStorage(s *StorageImpl) (Storage, error)

type StorageImpl

type StorageImpl struct {
	// contains filtered or unexported fields
}

func (*StorageImpl) AddSourcesToEvaluator

func (stor *StorageImpl) AddSourcesToEvaluator(ctx context.Context, evaluator_id string, sources []*Resource) error

func (*StorageImpl) CreateEvaluator

func (stor *StorageImpl) CreateEvaluator(ctx context.Context, e *Evaluator) (*Evaluator, error)

func (*StorageImpl) DeleteEvaluator

func (stor *StorageImpl) DeleteEvaluator(ctx context.Context, id string) error

func (*StorageImpl) ExistEvaluator

func (stor *StorageImpl) ExistEvaluator(ctx context.Context, e *Evaluator) (bool, error)

func (*StorageImpl) ExistOperator

func (stor *StorageImpl) ExistOperator(ctx context.Context, o *Operator) (bool, error)

func (*StorageImpl) GetDBConn

func (stor *StorageImpl) GetDBConn(ctx context.Context) *gorm.DB

func (*StorageImpl) GetEvaluator

func (stor *StorageImpl) GetEvaluator(ctx context.Context, id string) (*Evaluator, error)

func (*StorageImpl) GetRootDBConn

func (stor *StorageImpl) GetRootDBConn() *gorm.DB

func (*StorageImpl) ListEvaluators

func (stor *StorageImpl) ListEvaluators(ctx context.Context, e *Evaluator) ([]*Evaluator, error)

func (*StorageImpl) ListEvaluatorsBySource

func (stor *StorageImpl) ListEvaluatorsBySource(ctx context.Context, src *Resource) ([]*Evaluator, error)

func (*StorageImpl) PatchEvaluator

func (stor *StorageImpl) PatchEvaluator(ctx context.Context, id string, e *Evaluator) (*Evaluator, error)

func (*StorageImpl) RemoveSourcesFromEvaluator

func (stor *StorageImpl) RemoveSourcesFromEvaluator(ctx context.Context, evaluator_id string, sources []*Resource) error

type StorageImplOption

type StorageImplOption struct {
	IsTraced bool
}

type TracedStorage

type TracedStorage struct {
	*opentracing_storage_helper.BaseTracedStorage
	*StorageImpl
}

func (*TracedStorage) AddSourcesToEvaluator

func (s *TracedStorage) AddSourcesToEvaluator(ctx context.Context, evaluator_id string, sources []*Resource) error

func (*TracedStorage) CreateEvaluator

func (s *TracedStorage) CreateEvaluator(ctx context.Context, e *Evaluator) (*Evaluator, error)

func (*TracedStorage) DeleteEvaluator

func (s *TracedStorage) DeleteEvaluator(ctx context.Context, id string) error

func (*TracedStorage) ExistEvaluator

func (s *TracedStorage) ExistEvaluator(ctx context.Context, e *Evaluator) (bool, error)

func (*TracedStorage) ExistOperator

func (s *TracedStorage) ExistOperator(ctx context.Context, o *Operator) (bool, error)

func (*TracedStorage) GetEvaluator

func (s *TracedStorage) GetEvaluator(ctx context.Context, id string) (*Evaluator, error)

func (*TracedStorage) ListEvaluators

func (s *TracedStorage) ListEvaluators(ctx context.Context, e *Evaluator) ([]*Evaluator, error)

func (*TracedStorage) PatchEvaluator

func (s *TracedStorage) PatchEvaluator(ctx context.Context, id string, e *Evaluator) (*Evaluator, error)

func (*TracedStorage) RemoveSourcesFromEvaluator

func (s *TracedStorage) RemoveSourcesFromEvaluator(ctx context.Context, evaluator_id string, sources []*Resource) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL