database

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

ProviderSet is service providers.

Functions

func Device2Proto

func Device2Proto(device *model.Device) *database.Device

func NewDatabase

func NewDatabase(ctx context.Context, dbConf *conf.DatabaseConfig) (*gorm.DB, error)

Types

type DatabaseService

type DatabaseService struct {
	database.UnimplementedDatabaseServer
	// contains filtered or unexported fields
}

func NewDatabaseService

func NewDatabaseService(c *conf.DatabaseConfig) *DatabaseService

func (*DatabaseService) CreateCollectionInfo

func (s *DatabaseService) CreateCollectionInfo(ctx context.Context, req *database.CollectionInfo) (*database.Empty, error)

func (*DatabaseService) CreateDevice

func (*DatabaseService) FirstOrCreateDevice

func (s *DatabaseService) FirstOrCreateDevice(ctx context.Context, req *database.CreateDeviceReq) (*database.Device, error)

func (*DatabaseService) GetDevice

func (*DatabaseService) GetDeviceWithMac

func (s *DatabaseService) GetDeviceWithMac(ctx context.Context, req *database.GetDeviceWithMacReq) (*database.Device, error)

func (*DatabaseService) ListCollectionInfo

type DeviceLog added in v0.1.1

type DeviceLog struct {
	Level string `json:"level"`
	Msg   string `json:"msg"`
	Time  string `json:"time"`
}

type DeviceLogConsumer added in v0.1.1

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

func NewDeviceLogConsumer added in v0.1.1

func NewDeviceLogConsumer(dbs *DatabaseService) *DeviceLogConsumer

func (*DeviceLogConsumer) Cleanup added in v0.1.1

func (*DeviceLogConsumer) ConsumeClaim added in v0.1.1

func (*DeviceLogConsumer) DB added in v0.1.1

func (s *DeviceLogConsumer) DB() *dbUtils

func (*DeviceLogConsumer) Setup added in v0.1.1

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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