backend

package
v0.0.0-...-eec2a5c Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is service client for backend.

func New

func New(backendUrl string) Client

New constructs new backend client.

func (Client) AddReceipt

func (client Client) AddReceipt(userId string, text string) error

AddReceipt adds receipt for user.

func (client Client) GetLoginLink(userId int) (string, error)

GetLoginLink returns URL for automatic login.

func (Client) GetUser

func (client Client) GetUser(userId int) (User, error)

GetUser returns user by telegram id.

type GrpcClient

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

func NewGrpcClient

func NewGrpcClient(backendUrl string, creds credentials.TransportCredentials) *GrpcClient

NewGrpcClient creates instance of grpcClient.

func (*GrpcClient) AddReceipt

func (c *GrpcClient) AddReceipt(ctx context.Context, userId string, qr string) (statusMessage string, e error)

AddReceipt adds new receipt by bar code.

func (c *GrpcClient) GetLoginLink(ctx context.Context, telegramId int) (string, error)

GetLoginLink returns link to login for telegram user.

func (*GrpcClient) GetReceiptReport

func (c *GrpcClient) GetReceiptReport(ctx context.Context, userId string, qr string) ([]byte, string, error)

GetReceiptReport return receipt details as file.

func (*GrpcClient) GetUser

func (c *GrpcClient) GetUser(ctx context.Context, telegramId int) (*User, error)

GetUser returns user by telegramId.

func (*GrpcClient) GetUsers

func (c *GrpcClient) GetUsers(ctx context.Context) ([]User, error)

GetUsers returns all users.

func (*GrpcClient) RegisterUser

func (c *GrpcClient) RegisterUser(ctx context.Context, telegramId int, phone string) error

func (*GrpcClient) VerifyPhone

func (c *GrpcClient) VerifyPhone(ctx context.Context, telegramId int, code string) error

type User

type User struct {
	UserId     string
	TelegramId int
}

User represents userId to TelegramId relation.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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