api

package
v0.0.0-...-d85f73f Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2022 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	GetCacheDownloadsDir() string
	GetHighway(addr, username string) *highway.Highway
	GetRoutingHead(peerID, userID int64) *pb.MessageService_RoutingHead

	MessageSendMessage(ctx context.Context, username string, req *pb.MessageService_SendRequest) (*pb.MessageService_SendResponse, error)
	MessageUploadImage(ctx context.Context, username string, reqs ...*pb.Cmd0388_TryUploadImageRequest) ([]*pb.Cmd0388_TryUploadImageResponse, error)
}

type ParseModeType

type ParseModeType string
const (
	ParseModeHTML       ParseModeType = "HTML"
	ParseModeMarkdown   ParseModeType = "Markdown"
	ParseModeMarkdownV2 ParseModeType = "MarkdownV2"
)

type PhotoInputFiles

type PhotoInputFiles struct {
	Photo []*multipart.FileHeader `binding:"required" form:"photo" json:"photo"`
}

func (*PhotoInputFiles) GetPhoto

func (req *PhotoInputFiles) GetPhoto() interface{}

type PhotoInterface

type PhotoInterface interface {
	GetPhoto() interface{}
}

type PhotoSize

type PhotoSize struct {
	FileID       string `json:"file_id"`
	FileUniqueID string `json:"file_unique_id"`
	Width        int64  `json:"width"`
	Height       int64  `json:"height"`
	FileSize     int64  `json:"file_size"`
}

type PhotoString

type PhotoString struct {
	Photo string `binding:"required" form:"photo" json:"photo"`
}

func (*PhotoString) GetPhoto

func (req *PhotoString) GetPhoto() interface{}

type SendMessageRequest

type SendMessageRequest struct {
	ChatID                   string        `binding:"required" form:"chat_id" json:"chat_id"`
	Text                     string        `binding:"required" form:"text" json:"text"`
	ParseMode                ParseModeType `form:"parse_mode" json:"parse_mode,omitempty"`
	Entities                 []interface{} `form:"entities" json:"entities,omitempty"`
	DisableWebPagePreview    bool          `form:"disable_web_page_preview" json:"disable_web_page_preview,omitempty"`
	DisableNotification      bool          `form:"disable_notification" json:"disable_notification,omitempty"`
	ReplyToMessageID         int64         `form:"reply_to_message_id" json:"reply_to_message_id,omitempty"`
	AllowSendingWithoutReply bool          `form:"allow_sending_without_reply" json:"allow_sending_without_reply,omitempty"`
	ReplyMarkup              interface{}   `form:"reply_markup" json:"reply_markup,omitempty"`
}

type SendPhotoRequest

type SendPhotoRequest struct {
	ChatID                   string        `binding:"required" form:"chat_id" json:"chat_id"`
	Photo                    interface{}   ``
	Caption                  string        `form:"caption" json:"caption,omitempty"`
	ParseMode                ParseModeType `form:"parse_mode" json:"parse_mode,omitempty"`
	CaptionEntities          []interface{} `form:"caption_entities" json:"caption_entities,omitempty"`
	DisableNotification      bool          `form:"disable_notification" json:"disable_notification,omitempty"`
	ReplyToMessageID         int64         `form:"reply_to_message_id" json:"reply_to_message_id,omitempty"`
	AllowSendingWithoutReply bool          `form:"allow_sending_without_reply" json:"allow_sending_without_reply,omitempty"`
	ReplyMarkup              interface{}   `form:"reply_markup" json:"reply_markup,omitempty"`
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(tokens map[string]string) *Server

func (*Server) ResetClient

func (s *Server) ResetClient(ctx context.Context, client Client)

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

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