controllers

package
v0.0.0-...-53a2e65 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeviceAdd

func DeviceAdd(c *gin.Context)

func DeviceDelete

func DeviceDelete(c *gin.Context)

func DeviceGet

func DeviceGet(c *gin.Context)

func DeviceList

func DeviceList(c *gin.Context)

func DeviceUpdate

func DeviceUpdate(c *gin.Context)

func IssuedDeviceAdd

func IssuedDeviceAdd(c *gin.Context)

func IssuedDeviceDelete

func IssuedDeviceDelete(c *gin.Context)

func IssuedDeviceGet

func IssuedDeviceGet(c *gin.Context)

func IssuedDeviceList

func IssuedDeviceList(c *gin.Context)

func IssuedDeviceUpdate

func IssuedDeviceUpdate(c *gin.Context)

func Login

func Login(c *gin.Context)

Login

func Logout

func Logout(c *gin.Context)

Logout

func MetricsGet

func MetricsGet(c *gin.Context)

MetricsGet

func UserAdd

func UserAdd(c *gin.Context)

func UserDelete

func UserDelete(c *gin.Context)

func UserGet

func UserGet(c *gin.Context)

func UserList

func UserList(c *gin.Context)

func UserUpdate

func UserUpdate(c *gin.Context)

Types

type Device

type Device struct {
	ID             primitive.ObjectID `json:"id" bson:"_id"`
	UserID         primitive.ObjectID `json:"userId" bson:"userId"`
	Name           string             `json:"name" bson:"name"`
	LastMetricTime *time.Time         `json:"lastMetricTime" bson:"lastMetricTime"`
	Active         bool               `json:"active" bson:"active"`
	CreatedAt      time.Time          `json:"createdAt" bson:"createdAt"`
	UpdatedAt      time.Time          `json:"updatedAt" bson:"updatedAt"`
}

type IssuedDevice

type IssuedDevice struct {
	ID        primitive.ObjectID `json:"id" bson:"_id"`
	Type      string             `json:"type" bson:"type"`
	CreatedAt time.Time          `json:"createdAt" bson:"createdAt"`
	UpdatedAt time.Time          `json:"updatedAt" bson:"updatedAt"`
}

type ListQuery

type ListQuery struct {
	Page     int    `query:"p"`
	PageSize int    `query:"ps"`
	Sort     string `query:"s"`
	Dir      int    `query:"d"`
}

type MetricsQuery

type MetricsQuery struct {
	DeviceId string    `query:"deviceId"`
	Start    time.Time `query:"start" time_format:"2006-01-02T15:04:05Z" time_utc:"0"`
	End      time.Time `query:"start" time_format:"2006-01-02T15:04:05Z" time_utc:"0"`
}

type Session

type Session struct {
	ID        primitive.ObjectID `json:"_id" bson:"_id"`
	UserID    primitive.ObjectID `json:"userId" bson:"userId"`
	StartTime time.Time          `json:"startTime" bson:"startTime"`
	EndTime   *time.Time         `json:"endTime" bson:"endTime"`
	CreatedAt time.Time          `json:"createdAt" bson:"createdAt"`
	UpdatedAt time.Time          `json:"updatedAt" bson:"updatedAt"`
}

type User

type User struct {
	ID        primitive.ObjectID `json:"_id" bson:"_id"`
	Email     string             `json:"email,omitempty" bson:"email"`
	Password  string             `json:"password" bson:"password"`
	Name      string             `json:"name" bson:"name"`
	Surename  string             `json:"surename" bson:"surename"`
	Admin     bool               `json:"admin" bson:"admin"`
	Active    bool               `json:"active" bson:"active"`
	CreatedAt time.Time          `json:"createdAt" bson:"createdAt"`
	UpdatedAt time.Time          `json:"updatedAt" bson:"updatedAt"`
}

type Variables

type Variables struct {
	Conf *configuration.Configuration
	Db   *database.Database
	User *token.User
}

Jump to

Keyboard shortcuts

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