mysql

package
v0.0.0-...-258f086 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: Unlicense Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InfoCount

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

type MySQL

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

func New

func New(option *Options) *MySQL

func (*MySQL) Delete

func (s *MySQL) Delete(table string, where string) (int64, error)

func (*MySQL) GetAlarmSetting

func (s *MySQL) GetAlarmSetting(deviceID uint64, alarmType string) (string, string, uint)

func (*MySQL) GetDeviceInfo

func (s *MySQL) GetDeviceInfo(deviceID uint64) (sql.NullInt32, string)

func (*MySQL) GetDeviceInfoSyncRedis

func (s *MySQL) GetDeviceInfoSyncRedis() []SyncInfo

func (*MySQL) GetDeviceInformationCount

func (s *MySQL) GetDeviceInformationCount(deviceID uint64, infoType string) uint64

func (*MySQL) GetUserLanguage

func (s *MySQL) GetUserLanguage(userID uint64) string

func (*MySQL) GetUserPushTokens

func (s *MySQL) GetUserPushTokens(userID uint64) []PushToken

func (*MySQL) Insert

func (s *MySQL) Insert(table string, column []string, values []string) (int64, string, error)

func (*MySQL) InsertAlarm

func (s *MySQL) InsertAlarm(deviceID uint64, latitude, longitude, speed, gpsInformation, course, mcc, mnc, lac, cellID, terminalInformation,
	voltageLevel, gsmSignal, alarmMode, language, date, serialNumber string) (int64, bool)

func (*MySQL) InsertDeviceInformation

func (s *MySQL) InsertDeviceInformation(deviceID uint64, infoType string, content string) (int64, bool)

func (*MySQL) Update

func (s *MySQL) Update(table string, column []string, where string) (int64, bool)

func (*MySQL) UpdateDeviceInformation

func (s *MySQL) UpdateDeviceInformation(deviceID uint64, infoType string, content string) bool

type Options

type Options struct {
	Username     string
	Password     string
	Server       string
	Port         int
	Database     string
	MaxIdleTime  time.Duration
	MaxLifeTime  time.Duration
	MaxOpenConns int
	MaxIdleConns int
}

type PushToken

type PushToken struct {
	PushToken string `json:"pushToken"`
}

type SyncInfo

type SyncInfo struct {
	Id         uint64         `json:"id"`
	UserId     sql.NullInt32  `json:"user"`
	DeviceImei string         `json:"deviceImei"`
	ExpireDate sql.NullString `json:"expireDate"`
	ExpireTime string         `json:"expireTime"`
	ModelName  string         `json:"modelName"`
	Model      uint32         `json:"modelCode"`
}

Jump to

Keyboard shortcuts

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