klab

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data interface {
	InsertKlabDataBulk(ctx context.Context, payloads []KlabDataPayload) error
	GetDataByCustomerIDNoCustomer(ctx context.Context, idcustomer int32) (*KlabDataNoCustomerResponse, error)
	GetCustomerIDBySporttiID(ctx context.Context, sporttiID string) (int32, error)
}

type DataStore

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

func (*DataStore) GetCustomerByID

func (s *DataStore) GetCustomerByID(ctx context.Context, idcustomer int32) (klabsqlc.Customer, error)

func (*DataStore) GetCustomerIDBySporttiID

func (s *DataStore) GetCustomerIDBySporttiID(ctx context.Context, sporttiID string) (int32, error)

func (*DataStore) GetDataByCustomerIDNoCustomer

func (s *DataStore) GetDataByCustomerIDNoCustomer(ctx context.Context, idcustomer int32) (*KlabDataNoCustomerResponse, error)

func (*DataStore) InsertKlabDataBulk

func (s *DataStore) InsertKlabDataBulk(ctx context.Context, payloads []KlabDataPayload) error

type KLABStorage

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

kLABStorage

func NewKLABStorage

func NewKLABStorage(db *sql.DB) *KLABStorage

NewKLABStorage creates a new KLABStorage instance

func (*KLABStorage) Data

func (s *KLABStorage) Data() Data

func (*KLABStorage) Ping

func (s *KLABStorage) Ping(ctx context.Context) error

Methods

func (*KLABStorage) Users

func (s *KLABStorage) Users() Users

type KlabDataNoCustomer

type KlabDataNoCustomer struct {
	CustomerID   int32
	Measurements []klabsqlc.MeasurementList
	DirTests     []klabsqlc.Dirtest
	DirTestSteps []klabsqlc.Dirteststep
	DirReports   []klabsqlc.Dirreport
	DirRawData   []klabsqlc.Dirrawdatum
	DirResults   []klabsqlc.Dirresult
}

type KlabDataNoCustomerResponse

type KlabDataNoCustomerResponse struct {
	CustomerID   int32                     `json:"customer_id"`
	Measurements []KlabMeasurementResponse `json:"measurements"`
	DirTests     []KlabDirTestResponse     `json:"dirtest"`
	DirTestSteps []KlabDirTestStepResponse `json:"dirteststeps"`
	DirReports   []KlabDirReportResponse   `json:"dirreport"`
	DirRawData   []KlabDirRawDataResponse  `json:"dirrawdata"`
	DirResults   []KlabDirResultsResponse  `json:"dirresults"`
}

Main response struct

type KlabDirRawDataResponse

type KlabDirRawDataResponse struct {
	IdDirRawData  int32      `json:"idDirRawData"`
	IdMeasurement int32      `json:"idMeasurement"`
	RawData       *string    `json:"rawdata,omitempty"`
	ColumnData    *string    `json:"columndata,omitempty"`
	Info          *string    `json:"info,omitempty"`
	UnitsData     *string    `json:"unitsdata,omitempty"`
	CreatedBy     *int64     `json:"created_by,omitempty"`
	ModBy         *int64     `json:"mod_by,omitempty"`
	ModDate       *time.Time `json:"mod_date,omitempty"`
	Deleted       *int16     `json:"deleted,omitempty"`
	CreatedDate   *time.Time `json:"created_date,omitempty"`
	Modded        *int16     `json:"modded,omitempty"`
}

type KlabDirReportResponse

type KlabDirReportResponse struct {
	IdDirReport      int32      `json:"iddirreport"`
	PageInstructions *string    `json:"page_instructions,omitempty"`
	IdMeasurement    int32      `json:"idmeasurement"`
	TemplateRec      *int32     `json:"template_rec,omitempty"`
	LibrecName       *string    `json:"librec_name,omitempty"`
	CreatedBy        *int64     `json:"created_by,omitempty"`
	ModBy            *int64     `json:"mod_by,omitempty"`
	ModDate          *time.Time `json:"mod_date,omitempty"`
	Deleted          *int16     `json:"deleted,omitempty"`
	CreatedDate      *time.Time `json:"created_date,omitempty"`
	Modded           *int16     `json:"modded,omitempty"`
}

type KlabDirResultsResponse

type KlabDirResultsResponse struct {
	IdDirResults       int32      `json:"iddirresults"`
	IdMeasurement      int32      `json:"idmeasurement"`
	MaxVo2MlKgMin      *float64   `json:"max_vo2mlkgmin,omitempty"`
	MaxVo2MlMin        *float64   `json:"max_vo2mlmin,omitempty"`
	MaxVo2             *float64   `json:"max_vo2,omitempty"`
	MaxHr              *float64   `json:"max_hr,omitempty"`
	MaxSpeed           *float64   `json:"max_speed,omitempty"`
	MaxPace            *float64   `json:"max_pace,omitempty"`
	MaxP               *float64   `json:"max_p,omitempty"`
	MaxPkg             *float64   `json:"max_pkg,omitempty"`
	MaxAngle           *float64   `json:"max_angle,omitempty"`
	MaxLac             *float64   `json:"max_lac,omitempty"`
	MaxAdd1            *float64   `json:"max_add1,omitempty"`
	MaxAdd2            *float64   `json:"max_add2,omitempty"`
	MaxAdd3            *float64   `json:"max_add3,omitempty"`
	LacAnkVo2MlKgMin   *float64   `json:"lac_ank_vo2mlkgmin,omitempty"`
	LacAnkVo2MlMin     *float64   `json:"lac_ank_vo2mlmin,omitempty"`
	LacAnkVo2          *float64   `json:"lac_ank_vo2,omitempty"`
	LacAnkVo2Pr        *float64   `json:"lac_ank_vo2pr,omitempty"`
	LacAnkHr           *float64   `json:"lac_ank_hr,omitempty"`
	LacAnkSpeed        *float64   `json:"lac_ank_speed,omitempty"`
	LacAnkPace         *float64   `json:"lac_ank_pace,omitempty"`
	LacAnkP            *float64   `json:"lac_ank_p,omitempty"`
	LacAnkPkg          *float64   `json:"lac_ank_pkg,omitempty"`
	LacAnkAngle        *float64   `json:"lac_ank_angle,omitempty"`
	LacAnkLac          *float64   `json:"lac_ank_lac,omitempty"`
	LacAnkAdd1         *float64   `json:"lac_ank_add1,omitempty"`
	LacAnkAdd2         *float64   `json:"lac_ank_add2,omitempty"`
	LacAnkAdd3         *float64   `json:"lac_ank_add3,omitempty"`
	LacAerkVo2MlKgMin  *float64   `json:"lac_aerk_vo2mlkgmin,omitempty"`
	LacAerkVo2MlMin    *float64   `json:"lac_aerk_vo2mlmin,omitempty"`
	LacAerkVo2         *float64   `json:"lac_aerk_vo2,omitempty"`
	LacAerkVo2Pr       *float64   `json:"lac_aerk_vo2pr,omitempty"`
	LacAerkHr          *float64   `json:"lac_aerk_hr,omitempty"`
	LacAerkSpeed       *float64   `json:"lac_aerk_speed,omitempty"`
	LacAerkPace        *float64   `json:"lac_aerk_pace,omitempty"`
	LacAerkP           *float64   `json:"lac_aerk_p,omitempty"`
	LacAerkPkg         *float64   `json:"lac_aerk_pkg,omitempty"`
	LacAerkAngle       *float64   `json:"lac_aerk_angle,omitempty"`
	LacAerkLac         *float64   `json:"lac_aerk_lac,omitempty"`
	LacAerkAdd1        *float64   `json:"lac_aerk_add1,omitempty"`
	LacAerkAdd2        *float64   `json:"lac_aerk_add2,omitempty"`
	LacAerkAdd3        *float64   `json:"lac_aerk_add3,omitempty"`
	VentAnkVo2MlKgMin  *float64   `json:"vent_ank_vo2mlkgmin,omitempty"`
	VentAnkVo2MlMin    *float64   `json:"vent_ank_vo2mlmin,omitempty"`
	VentAnkVo2         *float64   `json:"vent_ank_vo2,omitempty"`
	VentAnkVo2Pr       *float64   `json:"vent_ank_vo2pr,omitempty"`
	VentAnkHr          *float64   `json:"vent_ank_hr,omitempty"`
	VentAnkSpeed       *float64   `json:"vent_ank_speed,omitempty"`
	VentAnkPace        *float64   `json:"vent_ank_pace,omitempty"`
	VentAnkP           *float64   `json:"vent_ank_p,omitempty"`
	VentAnkPkg         *float64   `json:"vent_ank_pkg,omitempty"`
	VentAnkAngle       *float64   `json:"vent_ank_angle,omitempty"`
	VentAnkLac         *float64   `json:"vent_ank_lac,omitempty"`
	VentAnkAdd1        *float64   `json:"vent_ank_add1,omitempty"`
	VentAnkAdd2        *float64   `json:"vent_ank_add2,omitempty"`
	VentAnkAdd3        *float64   `json:"vent_ank_add3,omitempty"`
	VentAerkVo2MlKgMin *float64   `json:"vent_aerk_vo2mlkgmin,omitempty"`
	VentAerkVo2MlMin   *float64   `json:"vent_aerk_vo2mlmin,omitempty"`
	VentAerkVo2        *float64   `json:"vent_aerk_vo2,omitempty"`
	VentAerkVo2Pr      *float64   `json:"vent_aerk_vo2pr,omitempty"`
	VentAerkHr         *float64   `json:"vent_aerk_hr,omitempty"`
	VentAerkSpeed      *float64   `json:"vent_aerk_speed,omitempty"`
	VentAerkPace       *float64   `json:"vent_aerk_pace,omitempty"`
	VentAerkP          *float64   `json:"vent_aerk_p,omitempty"`
	VentAerkPkg        *float64   `json:"vent_aerk_pkg,omitempty"`
	VentAerkAngle      *float64   `json:"vent_aerk_angle,omitempty"`
	VentAerkLac        *float64   `json:"vent_aerk_lac,omitempty"`
	VentAerkAdd1       *float64   `json:"vent_aerk_add1,omitempty"`
	VentAerkAdd2       *float64   `json:"vent_aerk_add2,omitempty"`
	VentAerkAdd3       *float64   `json:"vent_aerk_add3,omitempty"`
	CreatedBy          *int64     `json:"created_by,omitempty"`
	ModBy              *int64     `json:"mod_by,omitempty"`
	ModDate            *time.Time `json:"mod_date,omitempty"`
	Deleted            *int16     `json:"deleted,omitempty"`
	CreatedDate        *time.Time `json:"created_date,omitempty"`
	Modded             *int16     `json:"modded,omitempty"`
}

type KlabDirTestResponse

type KlabDirTestResponse struct {
	IdDirTest     int32      `json:"idDirTest"`
	IdMeasurement int32      `json:"idMeasurement"`
	MeasCols      *string    `json:"MeasCols,omitempty"`
	WeightKg      *float64   `json:"weightkg,omitempty"`
	HeightCm      *float64   `json:"heightcm,omitempty"`
	Bmi           *float64   `json:"bmi,omitempty"`
	FatPr         *float64   `json:"fat_pr,omitempty"`
	FatP1         *float64   `json:"fat_p1,omitempty"`
	FatP2         *float64   `json:"fat_p2,omitempty"`
	FatP3         *float64   `json:"fat_p3,omitempty"`
	FatP4         *float64   `json:"fat_p4,omitempty"`
	FatStyle      *int32     `json:"fat_style,omitempty"`
	FatEquip      *string    `json:"fat_equip,omitempty"`
	Fvc           *float64   `json:"fvc,omitempty"`
	Fev1          *float64   `json:"fev1,omitempty"`
	AirPress      *float64   `json:"air_press,omitempty"`
	AirTemp       *float64   `json:"air_temp,omitempty"`
	AirHumid      *float64   `json:"air_humid,omitempty"`
	TestProtocol  *string    `json:"testprotocol,omitempty"`
	AirPressUnit  *int32     `json:"air_press_unit,omitempty"`
	SettingsList  *string    `json:"settingslist,omitempty"`
	Lt1X          *float64   `json:"lt1_x,omitempty"`
	Lt1Y          *float64   `json:"lt1_y,omitempty"`
	Lt2X          *float64   `json:"lt2_x,omitempty"`
	Lt2Y          *float64   `json:"lt2_y,omitempty"`
	Vt1X          *float64   `json:"vt1_x,omitempty"`
	Vt2X          *float64   `json:"vt2_x,omitempty"`
	Vt1Y          *float64   `json:"vt1_y,omitempty"`
	Vt2Y          *float64   `json:"vt2_y,omitempty"`
	Lt1CalcX      *float64   `json:"lt1_calc_x,omitempty"`
	Lt1CalcY      *float64   `json:"lt1_calc_y,omitempty"`
	Lt2CalcX      *float64   `json:"lt2_calc_x,omitempty"`
	Lt2CalcY      *float64   `json:"lt2_calc_y,omitempty"`
	ProtocolModel *int16     `json:"protocolmodel,omitempty"`
	TestType      *int16     `json:"testtype,omitempty"`
	ProtocolXVal  *int16     `json:"protocolxval,omitempty"`
	StepTime      *int32     `json:"steptime,omitempty"`
	WRest         *int16     `json:"w_rest,omitempty"`
	CreatedBy     *int64     `json:"created_by,omitempty"`
	ModBy         *int64     `json:"mod_by,omitempty"`
	ModDate       *time.Time `json:"mod_date,omitempty"`
	Deleted       *int16     `json:"deleted,omitempty"`
	CreatedDate   *time.Time `json:"created_date,omitempty"`
	Modded        *int16     `json:"modded,omitempty"`
	NoRawData     *int16     `json:"norawdata,omitempty"`
}

type KlabDirTestStepResponse

type KlabDirTestStepResponse struct {
	IdDirTestSteps int32      `json:"iddirteststeps"`
	IdMeasurement  int32      `json:"idmeasurement"`
	StepNo         *int32     `json:"stepno,omitempty"`
	AnaTime        *int32     `json:"ana_time,omitempty"`
	TimeStop       *float64   `json:"timestop,omitempty"`
	Speed          *float64   `json:"speed,omitempty"`
	Pace           *float64   `json:"pace,omitempty"`
	Angle          *float64   `json:"angle,omitempty"`
	Elev           *float64   `json:"elev,omitempty"`
	Vo2Calc        *float64   `json:"vo2calc,omitempty"`
	TTot           *float64   `json:"t_tot,omitempty"`
	TEx            *float64   `json:"t_ex,omitempty"`
	Fico2          *float64   `json:"fico2,omitempty"`
	Fio2           *float64   `json:"fio2,omitempty"`
	Feco2          *float64   `json:"feco2,omitempty"`
	Feo2           *float64   `json:"feo2,omitempty"`
	Vde            *float64   `json:"vde,omitempty"`
	Vco2           *float64   `json:"vco2,omitempty"`
	Vo2            *float64   `json:"vo2,omitempty"`
	Bf             *float64   `json:"bf,omitempty"`
	Ve             *float64   `json:"ve,omitempty"`
	Petco2         *float64   `json:"petco2,omitempty"`
	Peto2          *float64   `json:"peto2,omitempty"`
	Vo2Kg          *float64   `json:"vo2kg,omitempty"`
	Re             *float64   `json:"re,omitempty"`
	Hr             *float64   `json:"hr,omitempty"`
	La             *float64   `json:"la,omitempty"`
	Rer            *float64   `json:"rer,omitempty"`
	VeStpd         *float64   `json:"ve_stpd,omitempty"`
	Veo2           *float64   `json:"veo2,omitempty"`
	Veco2          *float64   `json:"veco2,omitempty"`
	Tv             *float64   `json:"tv,omitempty"`
	EeAe           *float64   `json:"ee_ae,omitempty"`
	LaVo2          *float64   `json:"la_vo2,omitempty"`
	O2Pulse        *float64   `json:"o2pulse,omitempty"`
	VdeTv          *float64   `json:"vde_tv,omitempty"`
	Va             *float64   `json:"va,omitempty"`
	O2Sa           *float64   `json:"o2sa,omitempty"`
	Rpe            *float64   `json:"rpe,omitempty"`
	BpSys          *float64   `json:"bp_sys,omitempty"`
	BpDia          *float64   `json:"bp_dia,omitempty"`
	Own1           *float64   `json:"own1,omitempty"`
	Own2           *float64   `json:"own2,omitempty"`
	Own3           *float64   `json:"own3,omitempty"`
	Own4           *float64   `json:"own4,omitempty"`
	Own5           *float64   `json:"own5,omitempty"`
	StepIsRest     *int32     `json:"step_is_rest,omitempty"`
	StepIs30Max    *int32     `json:"step_is_30max,omitempty"`
	StepIs60Max    *int32     `json:"step_is_60max,omitempty"`
	StepIsRec      *int32     `json:"step_is_rec,omitempty"`
	CalcStart      *int32     `json:"calc_start,omitempty"`
	CalcEnd        *int32     `json:"calc_end,omitempty"`
	Comments       *string    `json:"comments,omitempty"`
	TimeStart      *float64   `json:"timestart,omitempty"`
	Duration       *float64   `json:"duration,omitempty"`
	Eco            *float64   `json:"eco,omitempty"`
	P              *float64   `json:"p,omitempty"`
	Wkg            *float64   `json:"wkg,omitempty"`
	Vo230s         *float64   `json:"vo2_30s,omitempty"`
	Vo2Pr          *float64   `json:"vo2_pr,omitempty"`
	StepIsLast     *int32     `json:"step_is_last,omitempty"`
	Deleted        *int16     `json:"deleted,omitempty"`
	CreatedBy      *int64     `json:"created_by,omitempty"`
	ModBy          *int64     `json:"mod_by,omitempty"`
	ModDate        *time.Time `json:"mod_date,omitempty"`
	CreatedDate    *time.Time `json:"created_date,omitempty"`
	Modded         *int16     `json:"modded,omitempty"`
	Own6           *float64   `json:"own6,omitempty"`
	Own7           *float64   `json:"own7,omitempty"`
	Own8           *float64   `json:"own8,omitempty"`
	Own9           *float64   `json:"own9,omitempty"`
	Own10          *float64   `json:"own10,omitempty"`
	To2            *float64   `json:"to2,omitempty"`
	Tco2           *float64   `json:"tco2,omitempty"`
}

type KlabMeasurementResponse

type KlabMeasurementResponse struct {
	IdMeasurement  int32      `json:"idMeasurement"`
	MeasName       *string    `json:"MeasName,omitempty"`
	IdCustomer     int32      `json:"idCustomer"`
	TableName      *string    `json:"tableName,omitempty"`
	IdPatternDef   *string    `json:"idpatterndef,omitempty"`
	DoYear         *int16     `json:"do_year,omitempty"`
	DoMonth        *int16     `json:"do_month,omitempty"`
	DoDay          *int16     `json:"do_day,omitempty"`
	DoHour         *int16     `json:"do_hour,omitempty"`
	DoMin          *int16     `json:"do_min,omitempty"`
	SessionNo      *int32     `json:"sessionno,omitempty"`
	Info           *string    `json:"info,omitempty"`
	Measurements   *string    `json:"measurements,omitempty"`
	GroupNotes     *string    `json:"groupnotes,omitempty"`
	CbCharts       *string    `json:"cbcharts,omitempty"`
	CbComments     *string    `json:"cbcomments,omitempty"`
	CreatedBy      *int64     `json:"created_by,omitempty"`
	ModBy          *int64     `json:"mod_by,omitempty"`
	ModDate        *time.Time `json:"mod_date,omitempty"`
	Deleted        *int16     `json:"deleted,omitempty"`
	CreatedDate    *time.Time `json:"created_date,omitempty"`
	Modded         *int16     `json:"modded,omitempty"`
	TestLocation   *string    `json:"test_location,omitempty"`
	Keywords       *string    `json:"keywords,omitempty"`
	TesterName     *string    `json:"tester_name,omitempty"`
	ModderName     *string    `json:"modder_name,omitempty"`
	MeasType       *int32     `json:"meastype,omitempty"`
	SentToSprintAI *time.Time `json:"sent_to_sprintai,omitempty"`
}

Clean response types (what you want in JSON)

type Users

type Users interface {
	GetCustomerByID(ctx context.Context, idcustomer int32) (klabsqlc.Customer, error)
	GetCustomerIDBySporttiID(ctx context.Context, sporttiID string) (int32, error)
	DeleteUserBySporttiID(ctx context.Context, sporttiID string) (string, error)
}

Interfaces

type UsersStore

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

func (*UsersStore) DeleteUserBySporttiID

func (s *UsersStore) DeleteUserBySporttiID(ctx context.Context, sporttiID string) (string, error)

func (*UsersStore) GetCustomerByID

func (s *UsersStore) GetCustomerByID(ctx context.Context, idcustomer int32) (klabsqlc.Customer, error)

func (*UsersStore) GetCustomerIDBySporttiID

func (s *UsersStore) GetCustomerIDBySporttiID(ctx context.Context, sporttiID string) (int32, error)

Jump to

Keyboard shortcuts

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