handlers

package
v0.0.0-...-798a471 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StaticPrefix = "/static/"
	Login        = "/login"
	CheckAuth    = "/check-auth"
)

Variables

This section is empty.

Functions

func ArchiveViewHandler

func ArchiveViewHandler(client ClientContext) func(c *fiber.Ctx) error

func Auth

func Auth(ctx ClientContext) func(c *fiber.Ctx) error

func IndexHandler

func IndexHandler(client ClientContext) func(c *fiber.Ctx) error

func MakeUserKey

func MakeUserKey(ui *tgauth.UserInfo) string

func MakeUserKeyFromUserNameAndId

func MakeUserKeyFromUserNameAndId(userName string, userId int64) string

func SearchHandler

func SearchHandler(client ClientContext) func(ctx *fiber.Ctx) error

func TrackUntrackArchiveHandler

func TrackUntrackArchiveHandler(client ClientContext, actionType ActionType) func(ctx *fiber.Ctx) error

Types

type ActionType

type ActionType int8
const (
	Track ActionType = iota
	Untrack
	Archive
)

type ClientContext

type ClientContext struct {
	RpcClient rpc.ClientInterface
	Auth      *tgauth.TelegramAuth
	Opts      *common.Options
}

func CreateTestingApp

func CreateTestingApp() (*fiber.App, ClientContext)

type SearchResultEntry

type SearchResultEntry struct {
	Entry   *proto.FoundEntry
	Tracked bool
}

func (*SearchResultEntry) GetEntryClass

func (entry *SearchResultEntry) GetEntryClass() string

func (*SearchResultEntry) GetUrl

func (entry *SearchResultEntry) GetUrl() string

type TrackedEntry

type TrackedEntry struct {
	Entry *proto.TrackedEntry
}

func GetTrackedEntries

func GetTrackedEntries(client ClientContext, userInfo *tgauth.UserInfo) ([]TrackedEntry, error)

func (*TrackedEntry) GetEntryClass

func (entry *TrackedEntry) GetEntryClass() string

func (*TrackedEntry) GetUrl

func (entry *TrackedEntry) GetUrl() string

Jump to

Keyboard shortcuts

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