Documentation ¶
Index ¶
- Constants
- Variables
- func Export(ctx context.Context, c *telegram.Client, kvd kv.KV, opts ExportOptions) (rerr error)
- func ExportTypeNames() []string
- func List(ctx context.Context, c *telegram.Client, kvd kv.KV, opts ListOptions) error
- func ListOutputNames() []string
- func Users(ctx context.Context, c *telegram.Client, kvd kv.KV, opts UsersOptions) (rerr error)
- type Dialog
- type ExportOptions
- type ExportType
- type ListOptions
- type ListOutput
- type Message
- type Topic
- type User
- type UsersOptions
Constants ¶
const ( DialogGroup = "group" DialogPrivate = "private" DialogChannel = "channel" DialogUnknown = "unknown" )
External designation, different from Telegram mtproto
Variables ¶
var ErrInvalidExportType = fmt.Errorf("not a valid ExportType, try [%s]", strings.Join(_ExportTypeNames, ", "))
var ErrInvalidListOutput = fmt.Errorf("not a valid ListOutput, try [%s]", strings.Join(_ListOutputNames, ", "))
Functions ¶
func ExportTypeNames ¶ added in v0.13.0
func ExportTypeNames() []string
ExportTypeNames returns a list of possible string values of ExportType.
func ListOutputNames ¶ added in v0.13.0
func ListOutputNames() []string
ListOutputNames returns a list of possible string values of ListOutput.
Types ¶
type Dialog ¶ added in v0.9.1
type Dialog struct { ID int64 `json:"id" comment:"ID of dialog"` Type string `json:"type" comment:"Type of dialog. Can be 'private', 'channel' or 'group'"` VisibleName string `json:"visible_name,omitempty" comment:"Title of channel and group, first and last name of user. If empty, output '-'"` Username string `json:"username,omitempty" comment:"Username of dialog. If empty, output '-'"` Topics []Topic `json:"topics,omitempty" comment:"Topics of dialog. If not set, output '-'"` }
type ExportOptions ¶ added in v0.7.0
type ExportType ¶ added in v0.13.0
type ExportType int
ExportType ENUM(time, id, last)
const ( // ExportTypeTime is a ExportType of type Time. ExportTypeTime ExportType = iota // ExportTypeId is a ExportType of type Id. ExportTypeId // ExportTypeLast is a ExportType of type Last. ExportTypeLast )
func ExportTypeValues ¶ added in v0.13.0
func ExportTypeValues() []ExportType
ExportTypeValues returns a list of the values for ExportType
func ParseExportType ¶ added in v0.13.0
func ParseExportType(name string) (ExportType, error)
ParseExportType attempts to convert a string to a ExportType.
func (*ExportType) Get ¶ added in v0.13.0
func (x *ExportType) Get() interface{}
Get implements the Golang flag.Getter interface func.
func (ExportType) IsValid ¶ added in v0.13.0
func (x ExportType) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (*ExportType) Set ¶ added in v0.13.0
func (x *ExportType) Set(val string) error
Set implements the Golang flag.Value interface func.
func (ExportType) String ¶ added in v0.13.0
func (x ExportType) String() string
String implements the Stringer interface.
func (*ExportType) Type ¶ added in v0.13.0
func (x *ExportType) Type() string
Type implements the github.com/spf13/pFlag Value interface.
type ListOptions ¶ added in v0.9.0
type ListOptions struct { Output ListOutput Filter string }
type ListOutput ¶ added in v0.13.0
type ListOutput int
ListOutput ENUM(table, json)
const ( // ListOutputTable is a ListOutput of type Table. ListOutputTable ListOutput = iota // ListOutputJson is a ListOutput of type Json. ListOutputJson )
func ListOutputValues ¶ added in v0.13.0
func ListOutputValues() []ListOutput
ListOutputValues returns a list of the values for ListOutput
func ParseListOutput ¶ added in v0.13.0
func ParseListOutput(name string) (ListOutput, error)
ParseListOutput attempts to convert a string to a ListOutput.
func (*ListOutput) Get ¶ added in v0.13.0
func (x *ListOutput) Get() interface{}
Get implements the Golang flag.Getter interface func.
func (ListOutput) IsValid ¶ added in v0.13.0
func (x ListOutput) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (*ListOutput) Set ¶ added in v0.13.0
func (x *ListOutput) Set(val string) error
Set implements the Golang flag.Value interface func.
func (ListOutput) String ¶ added in v0.13.0
func (x ListOutput) String() string
String implements the Stringer interface.
func (*ListOutput) Type ¶ added in v0.13.0
func (x *ListOutput) Type() string
Type implements the github.com/spf13/pFlag Value interface.