model

package
v0.0.0-...-d9f1a53 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

type Bot struct {
	Id    int64   `json:"id"`
	Token *string `json:"-"`
}

type BotStatus

type BotStatus int
var (
	StatusBotStopped BotStatus
	StatusBotRunning BotStatus = 1
)

type Command

type Command struct {
	Id          *int64        `json:"id"`
	Type        *string       `json:"type"`
	Data        *string       `json:"data"`
	ComponentId *int64        `json:"componentId"`
	NextStepId  *int64        `json:"nextStepId"`
	Status      CommandStatus `json:"status"`
}

type CommandStatus

type CommandStatus int
var (
	StatusCommandActive CommandStatus
	StatusCommandDel    CommandStatus = 1
)

type Commands

type Commands []*Command

type Component

type Component struct {
	Id         int64     `json:"id"`
	Data       *Data     `json:"data"`
	Keyboard   *Keyboard `json:"keyboard"`
	Commands   *Commands `json:"commands"`
	NextStepId *int64    `json:"nextStepId"`
	IsMain     bool      `json:"isMain"`
}

func (*Component) MarshalBinary

func (c *Component) MarshalBinary() ([]byte, error)

Encode component struct to binary format (for redis)

func (*Component) UnmarshalBinary

func (c *Component) UnmarshalBinary(data []byte) error

Decode component from binary format to struct (fo redis)

type ComponentData

type ComponentData struct {
	Type components.ComponentType `json:"type"`
	Data []byte                   `json:"data"`
}

func (*ComponentData) Component

func (cd *ComponentData) Component() (components.Component, error)

type ComponentStatus

type ComponentStatus int
var (
	StatusComponentActive ComponentStatus
	StatusComponentDel    ComponentStatus = 1
)

type Content

type Content struct {
	Text *string `json:"text,omitempty"`
}

type Data

type Data struct {
	Type    *string     `json:"type"`
	Content *[]*Content `json:"content"`
}

type Keyboard

type Keyboard struct {
	Buttons [][]*int64 `json:"buttons"`
}

type StepID

type StepID struct {
	StepId int64 `json:"stepId"`
}

type User

type User struct {
	Id        int64   `json:"id"`
	TgId      int64   `json:"tgId"`
	FirstName *string `json:"firstName"`
	LastName  *string `json:"lastName"`
	Username  *string `json:"username"`
	StepID
	Context *context.Context `json:"context"`
	Status  UserStatus       `json:"-"`
}

func (*User) MarshalBinary

func (c *User) MarshalBinary() ([]byte, error)

Encode component struct to binary format (for redis)

func (*User) UnmarshalBinary

func (c *User) UnmarshalBinary(data []byte) error

Decode component from binary format to struct (fo redis)

type UserStatus

type UserStatus int
var (
	StatusUserActive UserStatus
)

Jump to

Keyboard shortcuts

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