database

package
v0.0.0-...-9b07614 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: MulanPSL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDB

func CreateDB(dname, dsname string) (*sql.DB, error)

CreateDB opens sql service according to dname and dsname.

func InsertAKCertRow

func InsertAKCertRow(akcert []byte, did int64) error

InsertAKCertRow inserts ak cert row in table `akey_cert`.

func SetAllAKCertUnavailable

func SetAllAKCertUnavailable(did int64) error

SetAllAKCertUnavailable sets available=false in table `akey_cert` according to device id.

Types

type AKCertRow

type AKCertRow struct {
	Id        int64
	Device_id int64
	Cre_time  time.Time
	Exp_time  time.Time
	Akey_cert string
	Available bool
}

AKCertRow stores one record of ak cert key information in database table `akey_cert`.

type DKeyRow

type DKeyRow struct {
	Id          int64
	Device_cert string
	Registered  bool
	Trusted     bool
	Reg_time    time.Time
	Client_info string
}

DKeyRow stores one record of device key information in database table `device_key`.

func InsertDKeyRow

func InsertDKeyRow(dkcert []byte) (DKeyRow, error)

InsertDKeyRow inserts device key row in table `device_key`.

Jump to

Keyboard shortcuts

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