source

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package source contains concrete subscription sources used by the status engine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MemberInChat

func MemberInChat(member *models.ChatMember) bool

MemberInChat maps Telegram chat-member statuses to subscription presence.

Types

type Manual

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

Manual checks manual operator overrides: whitelist and manual periods.

func NewManual

func NewManual(
	whitelist whitelistChecker,
	subscriptions manualSubscriptionReader,
	opts ...ManualOption,
) *Manual

NewManual returns the manual override source.

func (*Manual) Platform

func (m *Manual) Platform() domain.Platform

Platform returns the source platform.

func (*Manual) Verdict

func (m *Manual) Verdict(
	ctx context.Context, tgID int64,
) (domain.SourceVerdict, error)

Verdict returns active for explicit manual access, otherwise no_signal.

type ManualOption

type ManualOption func(*Manual)

ManualOption configures Manual.

func WithManualClock

func WithManualClock(now func() time.Time) ManualOption

WithManualClock replaces time.Now for tests.

type Membership

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

Membership checks live Telegram membership in one source chat.

func NewMembership

func NewMembership(
	platform domain.Platform,
	chatID int64,
	checker memberChecker,
	opts ...MembershipOption,
) *Membership

NewMembership returns a Telegram membership source.

func (*Membership) Platform

func (m *Membership) Platform() domain.Platform

Platform returns the source platform.

func (*Membership) Verdict

func (m *Membership) Verdict(
	ctx context.Context, tgID int64,
) (domain.SourceVerdict, error)

Verdict probes Telegram and returns one four-valued source verdict.

type MembershipOption

type MembershipOption func(*Membership)

MembershipOption configures a membership source.

func WithClock

func WithClock(now func() time.Time) MembershipOption

WithClock replaces time.Now for tests.

func WithLedger

func WithLedger(ledger ledgerReader) MembershipOption

WithLedger adds the local ledger signal used by Tribute.

Jump to

Keyboard shortcuts

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