Documentation ¶
Index ¶
- Variables
- func CreateDeployment(ctx context.Context, db sqlx.Execer, d *Deployment) error
- func CreateDeploymentDevice(ctx context.Context, db sqlx.Execer, dd *DeploymentDevice) error
- func CreateDeploymentLog(ctx context.Context, db sqlx.Queryer, dl *DeploymentLog) error
- func DB() *sqlx.DB
- func MigrateDown(db *sqlx.DB) error
- func MigrateUp(db *sqlx.DB) error
- func Setup(conf *config.Config) error
- func Transaction(f func(tx sqlx.Ext) error) error
- func UpdateDeployment(ctx context.Context, db sqlx.Execer, d *Deployment) error
- func UpdateDeploymentDevice(ctx context.Context, db sqlx.Execer, dd *DeploymentDevice) error
- type Deployment
- type DeploymentDevice
- type DeploymentLog
Constants ¶
This section is empty.
Variables ¶
var (
ErrDoesNotExist = errors.New("object does not exist")
)
Functions ¶
func CreateDeployment ¶
CreateDeployment creates the given Deployment.
func CreateDeploymentDevice ¶
CreateDeploymentDevice creates the given DeploymentDevice.
func CreateDeploymentLog ¶
CreateDeploymentLog creates the given DeploymentLog.
func MigrateDown ¶
func Transaction ¶
Transaction wraps the given function in a transaction. In case the given functions returns an error, the transaction will be rolled back.
func UpdateDeployment ¶
UpdateDeployment updates the given Deployment.
func UpdateDeploymentDevice ¶
UpdateDeploymentDevice updates the given DeploymentDevice.
Types ¶
type Deployment ¶
type Deployment struct { ID uuid.UUID `db:"id"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` MCGroupSetupCompletedAt *time.Time `db:"mc_group_setup_completed_at"` MCSessionCompletedAt *time.Time `db:"mc_session_completed_at"` FragSessionSetupCompletedAt *time.Time `db:"frag_session_setup_completed_at"` EnqueueCompletedAt *time.Time `db:"enqueue_completed_at"` FragStatusCompletedAt *time.Time `db:"frag_status_completed_at"` }
Deployment represents a FUOTA deployment.
func GetDeployment ¶
GetDeployment returns the Deployment given an ID.
type DeploymentDevice ¶
type DeploymentDevice struct { DeploymentID uuid.UUID `db:"deployment_id"` DevEUI lorawan.EUI64 `db:"dev_eui"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` MCGroupSetupCompletedAt *time.Time `db:"mc_group_setup_completed_at"` MCSessionCompletedAt *time.Time `db:"mc_session_completed_at"` FragSessionSetupCompletedAt *time.Time `db:"frag_session_setup_completed_at"` FragStatusCompletedAt *time.Time `db:"frag_status_completed_at"` }
DeploymentDevice represents a device within a FUOTA deployment.
func GetDeploymentDevice ¶
func GetDeploymentDevice(ctx context.Context, db sqlx.Queryer, deploymentID uuid.UUID, devEUI lorawan.EUI64) (DeploymentDevice, error)
GetDeploymentDevice returns the DeploymentDevice for the given Deployment ID and DevEUI.
func GetDeploymentDevices ¶
func GetDeploymentDevices(ctx context.Context, db sqlx.Queryer, deploymentID uuid.UUID) ([]DeploymentDevice, error)
GetDeploymentDevices returns the DeploymentDevices for the given Deployment ID.
type DeploymentLog ¶
type DeploymentLog struct { ID int64 `db:"id"` CreatedAt time.Time `db:"created_at"` DeploymentID uuid.UUID `db:"deployment_id"` DevEUI lorawan.EUI64 `db:"dev_eui"` FPort uint8 `db:"f_port"` Command string `db:"command"` Fields hstore.Hstore `db:"fields"` }
DeploymentLog contains a deployment log item.