Documentation ¶
Overview ¶
Package examples contains usage examples for gotd features.
Index ¶
- func Run(f func(ctx context.Context, log *zap.Logger) error)
- type Terminal
- func (Terminal) AcceptTermsOfService(ctx context.Context, tos tg.HelpTermsOfService) error
- func (Terminal) Code(ctx context.Context, sentCode *tg.AuthSentCode) (string, error)
- func (Terminal) Password(_ context.Context) (string, error)
- func (a Terminal) Phone(_ context.Context) (string, error)
- func (Terminal) SignUp(ctx context.Context) (auth.UserInfo, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Terminal ¶
type Terminal struct {
PhoneNumber string // optional, will be prompted if empty
}
Terminal implements auth.UserAuthenticator prompting the terminal for input.
This is only example implementation, you should not use it in your code. Copy it and modify to fit your needs.
func (Terminal) AcceptTermsOfService ¶
Directories ¶
Path | Synopsis |
---|---|
Binary bg-run implements alternative to Run pattern.
|
Binary bg-run implements alternative to Run pattern. |
Binary bot-auth-manual implements example of custom session storage and manually setting up client options without environment variables.
|
Binary bot-auth-manual implements example of custom session storage and manually setting up client options without environment variables. |
Binary bot-echo implements basic example for bot.
|
Binary bot-echo implements basic example for bot. |
Binary bot-upload implements upload example for bot.
|
Binary bot-upload implements upload example for bot. |
Binary gif-download implements example of gif backup.
|
Binary gif-download implements example of gif backup. |
Click to show internal directories.
Click to hide internal directories.