machines

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Machine

type Machine struct {
	Client *sqlx.DB
}

func New

func New(client *sqlx.DB) *Machine

func (*Machine) Create

func (y *Machine) Create(u MachineCreateRequest) (id int64, err error)

func (Machine) FindAll

func (y Machine) FindAll(page, limit int) (res []MachineResponse, err error)

func (*Machine) FindById

func (y *Machine) FindById(id int) (res MachineResponse, err error)

func (*Machine) FindByMachineId

func (y *Machine) FindByMachineId(machineId string) (res MachineResponse, err error)

func (*Machine) FindFirst

func (y *Machine) FindFirst() (res MachineResponse, err error)

func (*Machine) FindLast

func (y *Machine) FindLast() (res MachineResponse, err error)

func (*Machine) UpdateDisableAccount

func (y *Machine) UpdateDisableAccount(id int) (err error)

func (*Machine) UpdateEnableAccount

func (y *Machine) UpdateEnableAccount(id int) (err error)

func (*Machine) UpdateMachineName

func (y *Machine) UpdateMachineName(id int, machineName string) (err error)

type MachineCreateRequest

type MachineCreateRequest struct {
	MachineUniqId    string `json:"machine_uiniqid" db:"machine_uniqid"`
	MachineName      string `json:"machine_name" db:"machine_name"`
	MachinePlataform string `json:"machine_plataform" db:"machine_plataform"`
	Active           bool   `json:"active" db:"active"`
}

type MachineResponse

type MachineResponse struct {
	ID               int       `json:"id" db:"id"`
	MachineUniqId    string    `json:"guid" db:"machine_uniqid"`
	MachineName      string    `json:"machine_name" db:"machine_name"`
	MachinePlataform string    `json:"machine_plataform" db:"machine_plataform"`
	Active           bool      `json:"active" db:"active"`
	CreatedAt        time.Time `json:"created_at" db:"created_at"`
	UpdatedAt        time.Time `json:"updated_at" db:"updated_at"`
}

Jump to

Keyboard shortcuts

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