send

package
v0.0.0-...-bae6b6e Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(log *slog.Logger, sender sender) http.HandlerFunc

New returns a new http.HandlerFunc that sends a message using the provided sender. It validates the request, converts it to a message, and sends it using the sender. If any error occurs during the process, it returns an error response. It requires an Authorization token in the request header.

Types

type Request

type Request struct {
	Message   string  `json:"message" validate:"required"`
	ParseMode string  `json:"parseMode,omitempty" validate:"parse-mode"`
	ChatIds   []int64 `json:"chatIds,omitempty"`
}

Request represents a request to send a message.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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