metathings_deviced_storage

package
v1.1.24-beta Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InvalidArgument = errors.New("invalid argument")
)

Functions

This section is empty.

Types

type Device

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

	HeartbeatAt *time.Time
	Kind        *string `gorm:"column:kind"`
	State       *string `gorm:"column:state"`
	Name        *string `gorm:"column:name"`
	Alias       *string `gorm:"column:alias"`
	Extra       *string `gorm:"column:extra"`

	Modules     []*Module         `gorm:"-"`
	Flows       []*Flow           `gorm:"-"`
	ExtraHelper map[string]string `gorm:"-"`
}

type Flow

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

	DeviceId *string `gorm:"column:device_id"`
	Name     *string `gorm:"column:name"`
	Alias    *string `gorm:"column:alias"`

	Device *Device `gorm:"-"`
}

type FlowFlowSetMapping added in v1.1.23

type FlowFlowSetMapping struct {
	CreatedAt time.Time

	FlowId    *string `gorm:"flow_id"`
	FlowSetId *string `gorm:"flow_set_id"`
}

type FlowSet added in v1.1.23

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

	Name  *string `gorm:"column:name"`
	Alias *string `gorm:"column:alias"`

	Flows []*Flow `gorm:"-"`
}

type Module

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

	HeartbeatAt *time.Time
	State       *string `gorm:"column:state"`
	DeviceId    *string `gorm:"column:device_id"`
	Endpoint    *string `gorm:"column:endpoint"`
	Component   *string `gorm:"column:component"`
	Name        *string `gorm:"column:name"`
	Alias       *string `gorm:"column:alias"`

	Device *Device `gorm:"-"`
}

type Storage

type Storage interface {
	CreateDevice(context.Context, *Device) (*Device, error)
	DeleteDevice(ctx context.Context, id string) error
	PatchDevice(ctx context.Context, id string, device *Device) (*Device, error)
	GetDevice(ctx context.Context, id string) (*Device, error)
	ListDevices(context.Context, *Device) ([]*Device, error)
	GetDeviceByModuleId(ctx context.Context, id string) (*Device, error)

	CreateModule(context.Context, *Module) (*Module, error)
	DeleteModule(ctx context.Context, id string) error
	PatchModule(ctx context.Context, id string, module *Module) (*Module, error)
	GetModule(ctx context.Context, id string) (*Module, error)
	ListModules(context.Context, *Module) ([]*Module, error)

	CreateFlow(context.Context, *Flow) (*Flow, error)
	DeleteFlow(ctx context.Context, id string) error
	PatchFlow(ctx context.Context, id string, flow *Flow) (*Flow, error)
	GetFlow(ctx context.Context, id string) (*Flow, error)
	ListFlows(context.Context, *Flow) ([]*Flow, error)

	CreateFlowSet(context.Context, *FlowSet) (*FlowSet, error)
	DeleteFlowSet(ctx context.Context, id string) error
	PatchFlowSet(ctx context.Context, id string, flow_set *FlowSet) (*FlowSet, error)
	GetFlowSet(ctx context.Context, id string) (*FlowSet, error)
	ListFlowSets(context.Context, *FlowSet) ([]*FlowSet, error)
	ListViewFlowSetsByFlowId(ctx context.Context, id string) ([]*FlowSet, error)
	AddFlowToFlowSet(ctx context.Context, flow_set_id, flow_id string) error
	RemoveFlowFromFlowSet(ctx context.Context, flow_set_id, flow_id string) 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 added in v1.1.18

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

type StorageImpl

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

func (*StorageImpl) AddFlowToFlowSet added in v1.1.23

func (self *StorageImpl) AddFlowToFlowSet(ctx context.Context, flwst_id, flw_id string) error

func (*StorageImpl) CreateDevice

func (self *StorageImpl) CreateDevice(ctx context.Context, dev *Device) (*Device, error)

func (*StorageImpl) CreateFlow

func (self *StorageImpl) CreateFlow(ctx context.Context, flw *Flow) (*Flow, error)

func (*StorageImpl) CreateFlowSet added in v1.1.23

func (self *StorageImpl) CreateFlowSet(ctx context.Context, flwst *FlowSet) (*FlowSet, error)

func (*StorageImpl) CreateModule

func (self *StorageImpl) CreateModule(ctx context.Context, mdl *Module) (*Module, error)

func (*StorageImpl) DeleteDevice

func (self *StorageImpl) DeleteDevice(ctx context.Context, id string) error

func (*StorageImpl) DeleteFlow

func (self *StorageImpl) DeleteFlow(ctx context.Context, id string) error

func (*StorageImpl) DeleteFlowSet added in v1.1.23

func (self *StorageImpl) DeleteFlowSet(ctx context.Context, id string) error

func (*StorageImpl) DeleteModule

func (self *StorageImpl) DeleteModule(ctx context.Context, id string) error

func (*StorageImpl) GetDBConn added in v1.1.18

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

func (*StorageImpl) GetDevice

func (self *StorageImpl) GetDevice(ctx context.Context, id string) (*Device, error)

func (*StorageImpl) GetDeviceByModuleId added in v0.100.0

func (self *StorageImpl) GetDeviceByModuleId(ctx context.Context, id string) (*Device, error)

func (*StorageImpl) GetFlow

func (self *StorageImpl) GetFlow(ctx context.Context, id string) (*Flow, error)

func (*StorageImpl) GetFlowSet added in v1.1.23

func (self *StorageImpl) GetFlowSet(ctx context.Context, id string) (*FlowSet, error)

func (*StorageImpl) GetModule

func (self *StorageImpl) GetModule(ctx context.Context, id string) (*Module, error)

func (*StorageImpl) GetRootDBConn added in v1.1.18

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

func (*StorageImpl) ListDevices

func (self *StorageImpl) ListDevices(ctx context.Context, dev *Device) ([]*Device, error)

func (*StorageImpl) ListFlowSets added in v1.1.23

func (self *StorageImpl) ListFlowSets(ctx context.Context, flwst *FlowSet) ([]*FlowSet, error)

func (*StorageImpl) ListFlows

func (self *StorageImpl) ListFlows(ctx context.Context, flw *Flow) ([]*Flow, error)

func (*StorageImpl) ListModules

func (self *StorageImpl) ListModules(ctx context.Context, mdl *Module) ([]*Module, error)

func (*StorageImpl) ListViewFlowSetsByFlowId added in v1.1.23

func (self *StorageImpl) ListViewFlowSetsByFlowId(ctx context.Context, id string) ([]*FlowSet, error)

func (*StorageImpl) PatchDevice

func (self *StorageImpl) PatchDevice(ctx context.Context, id string, device *Device) (*Device, error)

func (*StorageImpl) PatchFlow

func (self *StorageImpl) PatchFlow(ctx context.Context, id string, flw *Flow) (*Flow, error)

func (*StorageImpl) PatchFlowSet added in v1.1.23

func (self *StorageImpl) PatchFlowSet(ctx context.Context, id string, flwst *FlowSet) (*FlowSet, error)

func (*StorageImpl) PatchModule

func (self *StorageImpl) PatchModule(ctx context.Context, id string, mdl *Module) (*Module, error)

func (*StorageImpl) RemoveFlowFromFlowSet added in v1.1.23

func (self *StorageImpl) RemoveFlowFromFlowSet(ctx context.Context, flwst_id, flw_id string) error

type StorageImplOption added in v1.1.18

type StorageImplOption struct {
	IsTraced bool
}

type TracedStorage added in v1.1.18

type TracedStorage struct {
	*opentracing_storage_helper.BaseTracedStorage
	*StorageImpl
}

func (*TracedStorage) AddFlowToFlowSet added in v1.1.23

func (s *TracedStorage) AddFlowToFlowSet(ctx context.Context, flwst_id, flw_id string) error

func (*TracedStorage) CreateDevice added in v1.1.18

func (s *TracedStorage) CreateDevice(ctx context.Context, dev *Device) (*Device, error)

func (*TracedStorage) CreateFlow added in v1.1.18

func (s *TracedStorage) CreateFlow(ctx context.Context, flw *Flow) (*Flow, error)

func (*TracedStorage) CreateFlowSet added in v1.1.23

func (s *TracedStorage) CreateFlowSet(ctx context.Context, flwst *FlowSet) (*FlowSet, error)

func (*TracedStorage) CreateModule added in v1.1.18

func (s *TracedStorage) CreateModule(ctx context.Context, dev *Module) (*Module, error)

func (*TracedStorage) DeleteDevice added in v1.1.18

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

func (*TracedStorage) DeleteFlow added in v1.1.18

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

func (*TracedStorage) DeleteFlowSet added in v1.1.23

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

func (*TracedStorage) DeleteModule added in v1.1.18

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

func (*TracedStorage) GetDevice added in v1.1.18

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

func (*TracedStorage) GetDeviceByModuleId added in v1.1.18

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

func (*TracedStorage) GetFlow added in v1.1.18

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

func (*TracedStorage) GetFlowSet added in v1.1.23

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

func (*TracedStorage) GetModule added in v1.1.18

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

func (*TracedStorage) ListDevices added in v1.1.18

func (s *TracedStorage) ListDevices(ctx context.Context, dev *Device) ([]*Device, error)

func (*TracedStorage) ListFlowSets added in v1.1.23

func (s *TracedStorage) ListFlowSets(ctx context.Context, flwsts *FlowSet) ([]*FlowSet, error)

func (*TracedStorage) ListFlows added in v1.1.18

func (s *TracedStorage) ListFlows(ctx context.Context, flw *Flow) ([]*Flow, error)

func (*TracedStorage) ListModules added in v1.1.18

func (s *TracedStorage) ListModules(ctx context.Context, mdl *Module) ([]*Module, error)

func (*TracedStorage) PatchDevice added in v1.1.18

func (s *TracedStorage) PatchDevice(ctx context.Context, id string, device *Device) (*Device, error)

func (*TracedStorage) PatchFlow added in v1.1.18

func (s *TracedStorage) PatchFlow(ctx context.Context, id string, flow *Flow) (*Flow, error)

func (*TracedStorage) PatchFlowSet added in v1.1.23

func (s *TracedStorage) PatchFlowSet(ctx context.Context, id string, flwst *FlowSet) (*FlowSet, error)

func (*TracedStorage) PatchModule added in v1.1.18

func (s *TracedStorage) PatchModule(ctx context.Context, id string, module *Module) (*Module, error)

func (*TracedStorage) RemoveFlowFromFlowSet added in v1.1.23

func (s *TracedStorage) RemoveFlowFromFlowSet(ctx context.Context, flwst_id, flw_id string) error

Jump to

Keyboard shortcuts

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