device

package
v0.0.0-...-2ed53ce Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrProjectIDNotFound = errors.New("project id is not defined")
	ErrRepository        = errors.New("something when wrong on us, not you")
	ErrWhatsappClient    = errors.New("errors from whatsapp client")
	ErrWhatsappLibrary   = errors.New("errors from whatsmeow library")
	ErrAlreadyLoggedIn   = errors.New("client already logged in")
)

Functions

This section is empty.

Types

type CreateDeviceDto

type CreateDeviceDto struct {
	Name             string `form:"name" validate:"required,min=5,max=20"`
	Description      string `form:"description" validate:"max=140"`
	ClientDeviceID   string `form:"client_device_id" validate:"required"`
	CustomAttributes string `form:"custom_attributes" validate:"json"`
}

type Handler

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

func NewHandler

func NewHandler(log *gofx.Logger, svc *Service) *Handler

func (*Handler) CreateDeviceForm

func (h *Handler) CreateDeviceForm(e echo.Context) error

func (*Handler) Index

func (h *Handler) Index(e echo.Context) error

func (*Handler) RequestQR

func (h *Handler) RequestQR(e echo.Context) error

type RequestQRDto

type RequestQRDto struct {
	SessionID string `query:"session_id" validate:"required"`
}

type Service

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

func NewService

func NewService(log *gofx.Logger, repo *dbrepo.Queries, waCli *whatsapp.Client) *Service

func (*Service) CheckIfNotScanned

func (s *Service) CheckIfNotScanned(sessionID string)

func (*Service) CreateDevice

func (s *Service) CreateDevice(c *gofx.Context, payload *CreateDeviceDto) error

func (*Service) DecodeProjectID

func (s *Service) DecodeProjectID(c *gofx.Context, encodedID string) int32

func (*Service) GetDevicesByProjectID

func (s *Service) GetDevicesByProjectID(
	c *gofx.Context, encodedID string,
) ([]*dbrepo.GetDevicesByProjectEncodedIDRow, error)

func (*Service) RequestQRCode

func (s *Service) RequestQRCode(_ *gofx.Context, sessionID string) (string, error)

Jump to

Keyboard shortcuts

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