terminal

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package terminal contains authenticator implementation using terminal.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Terminal

type Terminal struct {
	*term.Terminal
	// contains filtered or unexported fields
}

Terminal implements UserAuthenticator.

func New added in v0.1.2

func New(in io.Reader, out io.Writer) *Terminal

New creates new Terminal.

func OS added in v0.1.2

func OS() *Terminal

OS creates new Terminal using os.Stdout and os.Stdin.

func (*Terminal) AcceptTermsOfService

func (t *Terminal) AcceptTermsOfService(ctx context.Context, tos tg.HelpTermsOfService) error

AcceptTermsOfService write terms of service received from Telegram and asks to accept it.

func (*Terminal) Code

func (t *Terminal) Code(ctx context.Context, sentCode *tg.AuthSentCode) (string, error)

Code asks code using terminal.

func (*Terminal) Password

func (t *Terminal) Password(ctx context.Context) (string, error)

Password asks password using terminal.

func (*Terminal) Phone

func (t *Terminal) Phone(ctx context.Context) (string, error)

Phone asks phone using terminal.

func (*Terminal) SignUp

func (t *Terminal) SignUp(ctx context.Context) (u tgauth.UserInfo, err error)

SignUp asks user info for sign up.

func (*Terminal) WithPrinter added in v0.4.0

func (t *Terminal) WithPrinter(printer *message.Printer) *Terminal

WithPrinter sets localization printer.

Jump to

Keyboard shortcuts

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