Documentation ¶
Index ¶
- Variables
- func Close(closer io.Closer)
- func SetQuotes(quotes []*Quote)
- type APIRequest
- type APIResponse
- type AnswerInline
- type AnswerInlineResult
- type AnswerInlineType
- type Client
- func (api *Client) Call(request *APIRequest, in interface{}) (err error)
- func (api *Client) Retrieve(endpoint string, in interface{}) (err error)
- func (api *Client) URL(format string, args ...interface{}) string
- func (api *Client) Upload(method MethodType, values map[string]io.Reader) (message *Message, err error)
- func (api *Client) WithURL(url string) *Client
- type CommonService
- type From
- type InlineQuery
- type InlineService
- type Message
- type MethodType
- type Quote
- type Update
- type UpdateType
- type Voice
- type VoiceMessage
Constants ¶
This section is empty.
Variables ¶
View Source
var Quotes map[string][]*Quote
Functions ¶
Types ¶
type APIRequest ¶
type APIRequest struct { Method string APIMethod MethodType ExpectStatus int Body io.Reader ContentType string }
APIRequest is a plain and simple structure to perform Gitlab DomainAPI requests.
type APIResponse ¶
type AnswerInline ¶
type AnswerInline struct { ID string `json:"inline_query_id"` Results []*AnswerInlineResult `json:"results"` }
func NewAnswerInline ¶
func NewAnswerInline(update *Update) (result *AnswerInline)
type AnswerInlineResult ¶
type AnswerInlineResult struct { Type AnswerInlineType `json:"type"` ID string `json:"id"` VoiceFileId *string `json:"voice_file_id,omitempty"` Title string `json:"title"` Caption string `json:"caption"` }
func NewInlineQueryResultCachedVoice ¶
func NewInlineQueryResultCachedVoice(update *Update) (results []*AnswerInlineResult)
type AnswerInlineType ¶
type AnswerInlineType string
const (
AnswerInlineTypeVoice AnswerInlineType = "voice"
)
type Client ¶
type Client struct { // Services Inlines *InlineService Commons *CommonService // contains filtered or unexported fields }
Client is a gitlab api client
func (*Client) Call ¶
func (api *Client) Call(request *APIRequest, in interface{}) (err error)
Call performs an generic http rest api calls.
func (*Client) Retrieve ¶
Retrieve is a basic GET operation for getting object (or in some particular cases, the list of objects)
type CommonService ¶
type CommonService struct {
// contains filtered or unexported fields
}
func (*CommonService) SendVoice ¶
func (service *CommonService) SendVoice(message *VoiceMessage) (err error)
type InlineQuery ¶
type InlineService ¶
type InlineService struct {
// contains filtered or unexported fields
}
func (*InlineService) AnswerInlineQuery ¶
func (service *InlineService) AnswerInlineQuery(update *Update) (err error)
type MethodType ¶
type MethodType string
const ( BotAPIURL = "https://api.telegram.org/bot" // Methods SendVoice MethodType = "sendVoice" AnswerInlineQuery MethodType = "answerInlineQuery" )
type Update ¶
type Update struct { ID int `json:"update_id"` Message *Message `json:"message,omitempty"` InlineQuery *InlineQuery `json:"inline_query,omitempty"` }
func ReadUpdate ¶
ReadUpdate reads an update entry sent via Webhook by telegram see also: https://core.telegram.org/bots/api#setwebhook
func (*Update) Type ¶
func (update *Update) Type() UpdateType
type UpdateType ¶
type UpdateType int
const ( UpdateTypeUnknown UpdateType = iota UpdateTypeInline UpdateTypeMessage )
type VoiceMessage ¶
type VoiceMessage struct { ChatID int `json:"chat_id"` Voice string `json:"voice"` Caption *string `json:"caption,omitempty"` ParseMode *string `json:"parse_mode,omitempty"` Duration *int `json:"duration,omitempty"` DisableNotification *int `json:"disable_notification,omitempty"` ReplyToMessageID *int `json:"reply_to_message_id,omitempty"` }
Click to show internal directories.
Click to hide internal directories.