Documentation
¶
Overview ¶
Package tgstore implements an encrypted object storage system with unlimited space backed by Telegram.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TGStore ¶
type TGStore struct { // BotAPIEndpoint is the endpoint of the Telegram Bot API. // // You might prefer to use your local Telegram Bot API server. See // https://core.telegram.org/bots/api#using-a-local-bot-api-server for // benefits. // // Default value: "https://api.telegram.org" BotAPIEndpoint string `mapstructure:"bot_api_endpoint"` // BotToken is the Telegram bot token. // // Default value: "" BotToken string `mapstructure:"bot_token"` // ChatID is the ID of the Telegram chat used to store the objects to be // uploaded. // // It is ok to change the `ChatID` if you want. The objects that have // already been uploaded are not affected. // // Default value: 0 ChatID int64 `mapstructure:"chat_id"` // MaxFileBytes is the maximum number of bytes allowed for a Telegram // file to have. // // The `MaxFileBytes` must be at least 20971520 (20 MiB). // // It is ok to change the `MaxFileBytes` if you want. The objects that // have already been uploaded are not affected. // // Default value: 20971520 MaxFileBytes int `mapstructure:"max_file_bytes"` // MaxObjectMetadataCacheBytes is the maximum number of bytes allowed // for object metadata cache to use. // // The `MaxObjectMetadataCacheBytes` must be at least 1048576 (1 MiB). // // Default value: 1048576 MaxObjectMetadataCacheBytes int `mapstructure:"max_object_metadata_cache_bytes"` // HTTPClient is the `http.Client` used to communicate with the Telegram // Bot API. // // Default value: `http.DefaultClient` HTTPClient *http.Client `mapstructure:"-"` // contains filtered or unexported fields }
TGStore is the top-level struct of this project.
It is highly recommended not to modify the value of any field of the `TGStore` after calling any methods of it, which will cause unpredictable problems.
The new instances of the `TGStore` should only be created by calling the `New`.
func New ¶
func New() *TGStore
New returns a new instance of the `TGStore` with default field values.
The `New` is the only function that creates new instances of the `TGStore` and keeps everything working.
Click to show internal directories.
Click to hide internal directories.