models

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TriggerEnumCAN string = "CAN"
	TriggerEnumPID string = "PID"
)

Enum values for TriggerEnum

Variables

View Source
var DBCCodeColumns = struct {
	ID               string
	Name             string
	DBCContents      string
	Header           string
	Trigger          string
	RecordingEnabled string
	MaxSampleSize    string
	CreatedAt        string
	UpdatedAt        string
}{
	ID:               "id",
	Name:             "name",
	DBCContents:      "dbc_contents",
	Header:           "header",
	Trigger:          "trigger",
	RecordingEnabled: "recording_enabled",
	MaxSampleSize:    "max_sample_size",
	CreatedAt:        "created_at",
	UpdatedAt:        "updated_at",
}
View Source
var DBCCodeRels = struct {
	TestSignals string
}{
	TestSignals: "TestSignals",
}

DBCCodeRels is where relationship names are stored.

View Source
var DBCCodeTableColumns = struct {
	ID               string
	Name             string
	DBCContents      string
	Header           string
	Trigger          string
	RecordingEnabled string
	MaxSampleSize    string
	CreatedAt        string
	UpdatedAt        string
}{
	ID:               "dbc_codes.id",
	Name:             "dbc_codes.name",
	DBCContents:      "dbc_codes.dbc_contents",
	Header:           "dbc_codes.header",
	Trigger:          "dbc_codes.trigger",
	RecordingEnabled: "dbc_codes.recording_enabled",
	MaxSampleSize:    "dbc_codes.max_sample_size",
	CreatedAt:        "dbc_codes.created_at",
	UpdatedAt:        "dbc_codes.updated_at",
}
View Source
var DBCCodeWhere = struct {
	ID               whereHelperstring
	Name             whereHelperstring
	DBCContents      whereHelpernull_String
	Header           whereHelpernull_Int
	Trigger          whereHelperstring
	RecordingEnabled whereHelperbool
	MaxSampleSize    whereHelperint
	CreatedAt        whereHelpertime_Time
	UpdatedAt        whereHelpertime_Time
}{
	ID:               whereHelperstring{/* contains filtered or unexported fields */},
	Name:             whereHelperstring{/* contains filtered or unexported fields */},
	DBCContents:      whereHelpernull_String{/* contains filtered or unexported fields */},
	Header:           whereHelpernull_Int{/* contains filtered or unexported fields */},
	Trigger:          whereHelperstring{/* contains filtered or unexported fields */},
	RecordingEnabled: whereHelperbool{/* contains filtered or unexported fields */},
	MaxSampleSize:    whereHelperint{/* contains filtered or unexported fields */},
	CreatedAt:        whereHelpertime_Time{/* contains filtered or unexported fields */},
	UpdatedAt:        whereHelpertime_Time{/* contains filtered or unexported fields */},
}
View Source
var ErrSyncFail = errors.New("models: failed to synchronize data after insert")

ErrSyncFail occurs during insert when the record could not be retrieved in order to populate default value information. This usually happens when LastInsertId fails or there was a primary key configuration that was not resolvable.

View Source
var TableNames = struct {
	DBCCodes    string
	TestSignals string
}{
	DBCCodes:    "dbc_codes",
	TestSignals: "test_signals",
}
View Source
var TestSignalColumns = struct {
	ID                 string
	DeviceDefinitionID string
	DBCCodesID         string
	UserDeviceID       string
	AutopiUnitID       string
	Value              string
	Approved           string
	VehicleTimestamp   string
	CreatedAt          string
	UpdatedAt          string
}{
	ID:                 "id",
	DeviceDefinitionID: "device_definition_id",
	DBCCodesID:         "dbc_codes_id",
	UserDeviceID:       "user_device_id",
	AutopiUnitID:       "autopi_unit_id",
	Value:              "value",
	Approved:           "approved",
	VehicleTimestamp:   "vehicle_timestamp",
	CreatedAt:          "created_at",
	UpdatedAt:          "updated_at",
}
View Source
var TestSignalRels = struct {
	DBCCode string
}{
	DBCCode: "DBCCode",
}

TestSignalRels is where relationship names are stored.

View Source
var TestSignalTableColumns = struct {
	ID                 string
	DeviceDefinitionID string
	DBCCodesID         string
	UserDeviceID       string
	AutopiUnitID       string
	Value              string
	Approved           string
	VehicleTimestamp   string
	CreatedAt          string
	UpdatedAt          string
}{
	ID:                 "test_signals.id",
	DeviceDefinitionID: "test_signals.device_definition_id",
	DBCCodesID:         "test_signals.dbc_codes_id",
	UserDeviceID:       "test_signals.user_device_id",
	AutopiUnitID:       "test_signals.autopi_unit_id",
	Value:              "test_signals.value",
	Approved:           "test_signals.approved",
	VehicleTimestamp:   "test_signals.vehicle_timestamp",
	CreatedAt:          "test_signals.created_at",
	UpdatedAt:          "test_signals.updated_at",
}
View Source
var TestSignalWhere = struct {
	ID                 whereHelperstring
	DeviceDefinitionID whereHelperstring
	DBCCodesID         whereHelperstring
	UserDeviceID       whereHelperstring
	AutopiUnitID       whereHelperstring
	Value              whereHelperstring
	Approved           whereHelperbool
	VehicleTimestamp   whereHelpertime_Time
	CreatedAt          whereHelpertime_Time
	UpdatedAt          whereHelpertime_Time
}{
	ID:                 whereHelperstring{/* contains filtered or unexported fields */},
	DeviceDefinitionID: whereHelperstring{/* contains filtered or unexported fields */},
	DBCCodesID:         whereHelperstring{/* contains filtered or unexported fields */},
	UserDeviceID:       whereHelperstring{/* contains filtered or unexported fields */},
	AutopiUnitID:       whereHelperstring{/* contains filtered or unexported fields */},
	Value:              whereHelperstring{/* contains filtered or unexported fields */},
	Approved:           whereHelperbool{/* contains filtered or unexported fields */},
	VehicleTimestamp:   whereHelpertime_Time{/* contains filtered or unexported fields */},
	CreatedAt:          whereHelpertime_Time{/* contains filtered or unexported fields */},
	UpdatedAt:          whereHelpertime_Time{/* contains filtered or unexported fields */},
}
View Source
var ViewNames = struct {
}{}

Functions

func AddDBCCodeHook

func AddDBCCodeHook(hookPoint boil.HookPoint, dbcCodeHook DBCCodeHook)

AddDBCCodeHook registers your hook function for all future operations.

func AddTestSignalHook

func AddTestSignalHook(hookPoint boil.HookPoint, testSignalHook TestSignalHook)

AddTestSignalHook registers your hook function for all future operations.

func AllTriggerEnum added in v0.1.3

func AllTriggerEnum() []string

func DBCCodeExists

func DBCCodeExists(ctx context.Context, exec boil.ContextExecutor, iD string) (bool, error)

DBCCodeExists checks if the DBCCode row exists.

func DBCCodes

func DBCCodes(mods ...qm.QueryMod) dbcCodeQuery

DBCCodes retrieves all the records using an executor.

func NewQuery

func NewQuery(mods ...qm.QueryMod) *queries.Query

NewQuery initializes a new Query using the passed in QueryMods

func TestSignalExists

func TestSignalExists(ctx context.Context, exec boil.ContextExecutor, iD string) (bool, error)

TestSignalExists checks if the TestSignal row exists.

func TestSignals

func TestSignals(mods ...qm.QueryMod) testSignalQuery

TestSignals retrieves all the records using an executor.

Types

type DBCCode

type DBCCode struct {
	ID               string      `boil:"id" json:"id" toml:"id" yaml:"id"`
	Name             string      `boil:"name" json:"name" toml:"name" yaml:"name"`
	DBCContents      null.String `boil:"dbc_contents" json:"dbc_contents,omitempty" toml:"dbc_contents" yaml:"dbc_contents,omitempty"`
	Header           null.Int    `boil:"header" json:"header,omitempty" toml:"header" yaml:"header,omitempty"`
	Trigger          string      `boil:"trigger" json:"trigger" toml:"trigger" yaml:"trigger"`
	RecordingEnabled bool        `boil:"recording_enabled" json:"recording_enabled" toml:"recording_enabled" yaml:"recording_enabled"`
	MaxSampleSize    int         `boil:"max_sample_size" json:"max_sample_size" toml:"max_sample_size" yaml:"max_sample_size"`
	CreatedAt        time.Time   `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	UpdatedAt        time.Time   `boil:"updated_at" json:"updated_at" toml:"updated_at" yaml:"updated_at"`

	R *dbcCodeR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L dbcCodeL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

DBCCode is an object representing the database table.

func FindDBCCode

func FindDBCCode(ctx context.Context, exec boil.ContextExecutor, iD string, selectCols ...string) (*DBCCode, error)

FindDBCCode retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.

func (*DBCCode) AddTestSignals

func (o *DBCCode) AddTestSignals(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*TestSignal) error

AddTestSignals adds the given related objects to the existing relationships of the dbc_code, optionally inserting them as new records. Appends related to o.R.TestSignals. Sets related.R.DBCCode appropriately.

func (*DBCCode) Delete

func (o *DBCCode) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)

Delete deletes a single DBCCode record with an executor. Delete will match against the primary key column to find the record to delete.

func (*DBCCode) Insert

func (o *DBCCode) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error

Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.

func (*DBCCode) Reload

func (o *DBCCode) Reload(ctx context.Context, exec boil.ContextExecutor) error

Reload refetches the object from the database using the primary keys with an executor.

func (*DBCCode) TestSignals

func (o *DBCCode) TestSignals(mods ...qm.QueryMod) testSignalQuery

TestSignals retrieves all the test_signal's TestSignals with an executor.

func (*DBCCode) Update

func (o *DBCCode) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)

Update uses an executor to update the DBCCode. See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. Update does not automatically update the record in case of default values. Use .Reload() to refresh the records.

func (*DBCCode) Upsert

func (o *DBCCode) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns) error

Upsert attempts an insert using an executor, and does an update or ignore on conflict. See boil.Columns documentation for how to properly use updateColumns and insertColumns.

type DBCCodeHook

type DBCCodeHook func(context.Context, boil.ContextExecutor, *DBCCode) error

DBCCodeHook is the signature for custom DBCCode hook methods

type DBCCodeSlice

type DBCCodeSlice []*DBCCode

DBCCodeSlice is an alias for a slice of pointers to DBCCode. This should almost always be used instead of []DBCCode.

func (DBCCodeSlice) DeleteAll

func (o DBCCodeSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)

DeleteAll deletes all rows in the slice, using an executor.

func (*DBCCodeSlice) ReloadAll

func (o *DBCCodeSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error

ReloadAll refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice.

func (DBCCodeSlice) UpdateAll

func (o DBCCodeSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)

UpdateAll updates all rows with the specified column values, using an executor.

type M

type M map[string]interface{}

M type is for providing columns and column values to UpdateAll.

type TestSignal

type TestSignal struct {
	ID                 string    `boil:"id" json:"id" toml:"id" yaml:"id"`
	DeviceDefinitionID string    `boil:"device_definition_id" json:"device_definition_id" toml:"device_definition_id" yaml:"device_definition_id"`
	DBCCodesID         string    `boil:"dbc_codes_id" json:"dbc_codes_id" toml:"dbc_codes_id" yaml:"dbc_codes_id"`
	UserDeviceID       string    `boil:"user_device_id" json:"user_device_id" toml:"user_device_id" yaml:"user_device_id"`
	AutopiUnitID       string    `boil:"autopi_unit_id" json:"autopi_unit_id" toml:"autopi_unit_id" yaml:"autopi_unit_id"`
	Value              string    `boil:"value" json:"value" toml:"value" yaml:"value"`
	Approved           bool      `boil:"approved" json:"approved" toml:"approved" yaml:"approved"`
	VehicleTimestamp   time.Time `boil:"vehicle_timestamp" json:"vehicle_timestamp" toml:"vehicle_timestamp" yaml:"vehicle_timestamp"`
	CreatedAt          time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	UpdatedAt          time.Time `boil:"updated_at" json:"updated_at" toml:"updated_at" yaml:"updated_at"`

	R *testSignalR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L testSignalL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

TestSignal is an object representing the database table.

func FindTestSignal

func FindTestSignal(ctx context.Context, exec boil.ContextExecutor, iD string, selectCols ...string) (*TestSignal, error)

FindTestSignal retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.

func (*TestSignal) DBCCode

func (o *TestSignal) DBCCode(mods ...qm.QueryMod) dbcCodeQuery

DBCCode pointed to by the foreign key.

func (*TestSignal) Delete

func (o *TestSignal) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)

Delete deletes a single TestSignal record with an executor. Delete will match against the primary key column to find the record to delete.

func (*TestSignal) Insert

func (o *TestSignal) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error

Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.

func (*TestSignal) Reload

func (o *TestSignal) Reload(ctx context.Context, exec boil.ContextExecutor) error

Reload refetches the object from the database using the primary keys with an executor.

func (*TestSignal) SetDBCCode

func (o *TestSignal) SetDBCCode(ctx context.Context, exec boil.ContextExecutor, insert bool, related *DBCCode) error

SetDBCCode of the testSignal to the related item. Sets o.R.DBCCode to related. Adds o to related.R.TestSignals.

func (*TestSignal) Update

func (o *TestSignal) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)

Update uses an executor to update the TestSignal. See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. Update does not automatically update the record in case of default values. Use .Reload() to refresh the records.

func (*TestSignal) Upsert

func (o *TestSignal) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns) error

Upsert attempts an insert using an executor, and does an update or ignore on conflict. See boil.Columns documentation for how to properly use updateColumns and insertColumns.

type TestSignalHook

type TestSignalHook func(context.Context, boil.ContextExecutor, *TestSignal) error

TestSignalHook is the signature for custom TestSignal hook methods

type TestSignalSlice

type TestSignalSlice []*TestSignal

TestSignalSlice is an alias for a slice of pointers to TestSignal. This should almost always be used instead of []TestSignal.

func (TestSignalSlice) DeleteAll

func (o TestSignalSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)

DeleteAll deletes all rows in the slice, using an executor.

func (*TestSignalSlice) ReloadAll

func (o *TestSignalSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error

ReloadAll refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice.

func (TestSignalSlice) UpdateAll

func (o TestSignalSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)

UpdateAll updates all rows with the specified column values, using an executor.

Jump to

Keyboard shortcuts

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