repo

package
v0.0.0-...-d84cd13 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConstructionPGRepository

type ConstructionPGRepository struct{}

func (*ConstructionPGRepository) Create

func (*ConstructionPGRepository) Delete

func (c *ConstructionPGRepository) Delete(ctx *gofr.Context, id int64) (bool, error)

func (*ConstructionPGRepository) GetAll

func (*ConstructionPGRepository) GetById

func (*ConstructionPGRepository) Update

func (*ConstructionPGRepository) UpdateOrDelete

func (c *ConstructionPGRepository) UpdateOrDelete(ctx *gofr.Context, data *usecase.ConstructionEntity) (bool, error)

func (*ConstructionPGRepository) UpdateOrInsert

func (c *ConstructionPGRepository) UpdateOrInsert(ctx *gofr.Context, data *usecase.ConstructionEntity) (bool, error)

type ConstructionRepo

type ConstructionRepo interface {
	GetAll(ctx *gofr.Context) (*[]usecase.ConstructionEntity, error)
	GetById(ctx *gofr.Context, id int64) (*usecase.ConstructionEntity, error)
	Create(ctx *gofr.Context, data *usecase.ConstructionEntity) (bool, error)
	Update(ctx *gofr.Context, data *usecase.ConstructionEntity) (bool, error)
	Delete(ctx *gofr.Context, id int64) (bool, error)
}

type Schema

type Schema struct {
	Time time.Time   `json:"time"`
	Data *SchemaTest `json:"data"`
}

type SchemaTest

type SchemaTest struct {
	Deformation []struct {
		Absv float64 `json:"absv"`
		Id   int     `json:"id"`
		Ts   int64   `json:"ts"`
		X    float64 `json:"x"`
		Y    float64 `json:"y"`
		Z    float64 `json:"z"`
	} `json:"deformation"`
	DeviceId    string `json:"deviceId"`
	Environment struct {
		Humidity  float64 `json:"humidity"`
		InnerTemp float64 `json:"innerTemp"`
		Temp      float64 `json:"temp"`
	} `json:"environment"`
	RealDis int `json:"realDis"`
	Slant   struct {
		X float64 `json:"x"`
		Y float64 `json:"y"`
		Z float64 `json:"z"`
	} `json:"slant"`
	Ts int64 `json:"ts"`
}

func (*SchemaTest) Scan

func (i *SchemaTest) Scan(value interface{}) error

func (*SchemaTest) Value

func (i *SchemaTest) Value() (driver.Value, error)

type TelemetryRepo

type TelemetryRepo[T any] interface {
	GetTelemetriesByTime(timeEnum TimeEnum) (*[]T, error)
	CreateTelemetry(data Schema) (bool, error)
}

type TelemetryTSRepository

type TelemetryTSRepository struct {
	C *gofr.Context
}

func (*TelemetryTSRepository) CreateTelemetry

func (t *TelemetryTSRepository) CreateTelemetry(data Schema) (bool, error)

func (*TelemetryTSRepository) GetTelemetriesByTime

func (t *TelemetryTSRepository) GetTelemetriesByTime(timeEnum TimeEnum) (*[]Schema, error)

type TimeEnum

type TimeEnum string
const (
	OneMinute      TimeEnum = "1 minutes"
	FifteenMinutes TimeEnum = "15 minutes"
	TwelveHours    TimeEnum = "12 hours"
	OneDay         TimeEnum = "1 day"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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