common

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StateKeyService     = "serv"
	StateKeyConfig      = "cfg"
	StateKeyLogger      = "logger"
	StateKeyTelegramBot = "telegrambot" // DO NOT USE MustGetState to get this value!
)

Variables

This section is empty.

Functions

func GetState

func GetState[T any](ctx fiber.Ctx, key string) (T, bool)

func MustGetState

func MustGetState[T any](ctx fiber.Ctx, key string) T

Types

type Error

type Error struct {
	Status  int    `json:"status"`
	Message string `json:"message"`
}

func NewError

func NewError(status int, message string) *Error

func (*Error) Error

func (e *Error) Error() string

func (*Error) Response

func (e *Error) Response() *Response[any]

type Response

type Response[T any] struct {
	Status  int    `json:"status"`
	Message string `json:"message"`
	Data    T      `json:"data"`
}

func NewSuccess

func NewSuccess[T any](data T) *Response[T]

type TelegramBot

type TelegramBot interface {
	SendArtworkInfo(ctx context.Context, sourceUrl string, chatID int64, appendCaption string) error
}

Jump to

Keyboard shortcuts

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