storage

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountInfo

type AccountInfo struct {
	Id            int64  `json:"id"`
	Email         string `json:"email"`
	MaxNodesCount int64  `json:"max_nodes_count"`
	NodesCount    int64  `json:"nodes_count"`
}

type NodeResponseItem

type NodeResponseItem struct {
	Id              string `json:"id"`
	Name            string `json:"name"`
	CurrentRepeater string `json:"current_repeater"`
}

type NodesResponse

type NodesResponse struct {
	Items []NodeResponseItem `json:"items"`
}

type RegRequest

type RegRequest struct {
	Id       int64
	EMail    string
	DT       int64
	Password string
	Key      string
}

type ServerInfo

type ServerInfo struct {
	Id      int64
	Name    string
	Code    string
	Role    string
	Config  string
	Enabled bool
}

type Session

type Session struct {
	Id             int64
	UserId         int64
	Key            string
	LastUpdateTime time.Time
}

type Storage

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

func NewStorage

func NewStorage() *Storage

func (*Storage) AddOrder

func (c *Storage) AddOrder(userId int64, name string, key string, active bool, product string, quantity int64, price float64, rawData string) (orderId int64, err error)

func (*Storage) ChangePassword

func (c *Storage) ChangePassword(session *Session, password string) (err error)

func (*Storage) ChangePasswordByKey

func (c *Storage) ChangePasswordByKey(key string, password string) (err error)

func (*Storage) CheckNode

func (c *Storage) CheckNode(userId int64, nodeIdAsString string) (nodeName string, err error)

func (*Storage) ConfirmRegistration

func (c *Storage) ConfirmRegistration(key string) (email string, err error)

func (*Storage) Directory

func (c *Storage) Directory() (res map[string]string, err error)

func (*Storage) Get

func (c *Storage) Get() (*User, error)

func (*Storage) GetAccountInfo

func (c *Storage) GetAccountInfo(userId int64) (accountInfo AccountInfo, err error)

func (*Storage) GetAccountInfoByEMail

func (c *Storage) GetAccountInfoByEMail(email string) (accountInfo AccountInfo, err error)

func (*Storage) GetPassword

func (c *Storage) GetPassword(email string) (password string, err error)

func (*Storage) Log

func (c *Storage) Log(tp string, content string)

func (*Storage) NodeAdd

func (c *Storage) NodeAdd(userId int64, name string) (nodeId string, err error)

func (*Storage) NodeRemove

func (c *Storage) NodeRemove(userId int64, nodeId string) (err error)

func (*Storage) NodeUpdate

func (c *Storage) NodeUpdate(userId int64, nodeId string, name string) (err error)

func (*Storage) Nodes

func (c *Storage) Nodes(userId int64) (res *NodesResponse, err error)

func (*Storage) Registration

func (c *Storage) Registration(eMail string, password string, addr string, recaptcha string, score float64) (string, error)

func (*Storage) ResetPasswordByIdAndKey

func (c *Storage) ResetPasswordByIdAndKey(email string, oldPassword string) (string, error)

func (*Storage) ServerRole

func (c *Storage) ServerRole(code string) (role string, err error)

func (*Storage) Servers

func (c *Storage) Servers() (res []ServerInfo, err error)

func (*Storage) SessionCheck

func (c *Storage) SessionCheck(sessionKey string) (*Session, error)

func (*Storage) SessionClose

func (c *Storage) SessionClose(key string, userId int64) (err error)

func (*Storage) SessionOpen

func (c *Storage) SessionOpen(userName string, password string) (string, error)

func (*Storage) UpdateMaxNodesCount

func (c *Storage) UpdateMaxNodesCount(userId int64) (err error)

func (*Storage) UserAdd

func (c *Storage) UserAdd()

func (*Storage) UserConfirm

func (c *Storage) UserConfirm()

func (*Storage) UserRemove

func (c *Storage) UserRemove()

type User

type User struct {
	Id       int64
	Name     string
	Email    string
	Password string
}

Jump to

Keyboard shortcuts

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