business

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const Table = "accesstokens"

Variables

This section is empty.

Functions

This section is empty.

Types

type Accesstoken

type Accesstoken struct {
	*_business.Accesstoken
	Database  *db.Sqlite `json:"-"`
	Token     *string    `json:"token"`
	DeviceId  string     `json:"device_id"`
	CreatedAt time.Time  `json:"date_created"`
	UpdatedAt time.Time  `json:"date_updated"`
}

func NewAccesstoken

func NewAccesstoken(id *string, database *db.Sqlite) *Accesstoken

func (*Accesstoken) Authenticate

func (a *Accesstoken) Authenticate(token string) (*Accesstoken, int, error)

Authenticate accesstoken

func (*Accesstoken) Create

func (a *Accesstoken) Create(create *AccesstokenCreate) (*Accesstoken, int, error)

Create accesstoken

func (*Accesstoken) Delete

func (a *Accesstoken) Delete() (*Accesstoken, int, error)

Delete accesstoken

func (*Accesstoken) Read

func (a *Accesstoken) Read() (*Accesstoken, int, error)

Read accesstoken

type AccesstokenCreate

type AccesstokenCreate struct {
	DeviceId string `json:"device_id"`
}

type Data

type Data struct {
	Database *db.Influx `json:"-"`
}

func NewData

func NewData(database *db.Influx) *Data

func (*Data) Create

func (d *Data) Create(createData _business.DataCreate) (*_business.DataCreateResponse, int, error)

func (*Data) Read

type DataSupport

type DataSupport struct {
	Enabled bool
}

type Device

type Device struct {
	*_business.Device
	Database *db.Sqlite `json:"-"`
}

func NewDevice

func NewDevice(id *string, database *db.Sqlite) *Device

func (*Device) Create

func (d *Device) Create(create *_business.DeviceCreate) (*Device, int, error)

Create device

func (*Device) Delete

func (d *Device) Delete() (*Device, int, error)

Delete device

func (*Device) Exists

func (d *Device) Exists() (bool, error)

func (*Device) Read

func (d *Device) Read() (*Device, int, error)

Read device

func (*Device) Update

func (d *Device) Update(update *_business.DeviceUpdate) (*Device, int, error)

Update device

type DeviceSupport

type DeviceSupport struct {
	Enabled bool
}

Jump to

Keyboard shortcuts

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