Documentation ¶
Index ¶
- func ClassifyDomain(domain string) chat1.UnfurlType
- func GetDefaultAppleTouchURL(uri string) (string, error)
- func GetDefaultFaviconURL(uri string) (string, error)
- func GetDomain(uri string) (res string, err error)
- func GetHostname(uri string) (string, error)
- func IsDomain(domain, target string) bool
- type Extractor
- type ExtractorHit
- type ExtractorHitTyp
- type OneTimeWhitelistExemption
- type Packager
- type Scraper
- type Settings
- func (s *Settings) Get(ctx context.Context, uid gregor1.UID) (res chat1.UnfurlSettings, err error)
- func (s *Settings) Set(ctx context.Context, uid gregor1.UID, settings chat1.UnfurlSettings) (err error)
- func (s *Settings) SetMode(ctx context.Context, uid gregor1.UID, mode chat1.UnfurlMode) (err error)
- func (s *Settings) WhitelistAdd(ctx context.Context, uid gregor1.UID, domain string) (err error)
- func (s *Settings) WhitelistRemove(ctx context.Context, uid gregor1.UID, domain string) (err error)
- type SingleMessageWhitelistExemption
- type UnfurlMessageSender
- type Unfurler
- func (u *Unfurler) Complete(ctx context.Context, outboxID chat1.OutboxID)
- func (u *Unfurler) GetSettings(ctx context.Context, uid gregor1.UID) (res chat1.UnfurlSettings, err error)
- func (u *Unfurler) Prefetch(ctx context.Context, uid gregor1.UID, convID chat1.ConversationID, ...) (numPrefetched int)
- func (u *Unfurler) Retry(ctx context.Context, outboxID chat1.OutboxID)
- func (u *Unfurler) SetClock(clock clockwork.Clock)
- func (u *Unfurler) SetMode(ctx context.Context, uid gregor1.UID, mode chat1.UnfurlMode) (err error)
- func (u *Unfurler) SetSettings(ctx context.Context, uid gregor1.UID, settings chat1.UnfurlSettings) (err error)
- func (u *Unfurler) SetTestingRetryCh(ch chan struct{})
- func (u *Unfurler) SetTestingUnfurlCh(ch chan *chat1.Unfurl)
- func (u *Unfurler) Status(ctx context.Context, outboxID chat1.OutboxID) (status types.UnfurlerTaskStatus, res *chat1.UnfurlResult, err error)
- func (u *Unfurler) UnfurlAndSend(ctx context.Context, uid gregor1.UID, convID chat1.ConversationID, ...)
- func (u *Unfurler) WhitelistAdd(ctx context.Context, uid gregor1.UID, domain string) (err error)
- func (u *Unfurler) WhitelistAddExemption(ctx context.Context, uid gregor1.UID, exemption types.WhitelistExemption)
- func (u *Unfurler) WhitelistRemove(ctx context.Context, uid gregor1.UID, domain string) (err error)
- type WhitelistExemptionList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClassifyDomain ¶
func ClassifyDomain(domain string) chat1.UnfurlType
func GetDefaultAppleTouchURL ¶
func GetDefaultFaviconURL ¶
func GetHostname ¶
Types ¶
type Extractor ¶
type Extractor struct { utils.DebugLabeler // contains filtered or unexported fields }
func NewExtractor ¶
func (*Extractor) AddWhitelistExemption ¶
type ExtractorHit ¶
type ExtractorHit struct { URL string Typ ExtractorHitTyp }
type ExtractorHitTyp ¶
type ExtractorHitTyp int
const ( ExtractorHitUnfurl ExtractorHitTyp = iota ExtractorHitPrompt )
type OneTimeWhitelistExemption ¶
func NewOneTimeWhitelistExemption ¶
func NewOneTimeWhitelistExemption(convID chat1.ConversationID, msgID chat1.MessageID, domain string) *OneTimeWhitelistExemption
func (*OneTimeWhitelistExemption) Domain ¶
func (o *OneTimeWhitelistExemption) Domain() string
func (*OneTimeWhitelistExemption) Matches ¶
func (o *OneTimeWhitelistExemption) Matches(convID chat1.ConversationID, msgID chat1.MessageID, domain string) bool
func (*OneTimeWhitelistExemption) Use ¶
func (o *OneTimeWhitelistExemption) Use() bool
type Packager ¶
type Packager struct { globals.Contextified utils.DebugLabeler // contains filtered or unexported fields }
func NewPackager ¶
func NewPackager(g *globals.Context, store attachments.Store, s3signer s3.Signer, ri func() chat1.RemoteInterface) *Packager
type Scraper ¶
type Scraper struct { globals.Contextified utils.DebugLabeler // contains filtered or unexported fields }
func NewScraper ¶
type Settings ¶
type Settings struct { utils.DebugLabeler // contains filtered or unexported fields }
func NewSettings ¶
func NewSettings(g *globals.Context, storage types.UserConversationBackedStorage) *Settings
func (*Settings) WhitelistAdd ¶
type SingleMessageWhitelistExemption ¶
type SingleMessageWhitelistExemption struct { sync.Mutex // contains filtered or unexported fields }
func NewSingleMessageWhitelistExemption ¶
func NewSingleMessageWhitelistExemption(convID chat1.ConversationID, msgID chat1.MessageID, domain string) *SingleMessageWhitelistExemption
func (*SingleMessageWhitelistExemption) Domain ¶
func (o *SingleMessageWhitelistExemption) Domain() string
func (*SingleMessageWhitelistExemption) Matches ¶
func (o *SingleMessageWhitelistExemption) Matches(convID chat1.ConversationID, msgID chat1.MessageID, domain string) bool
func (*SingleMessageWhitelistExemption) Use ¶
func (o *SingleMessageWhitelistExemption) Use() bool
type UnfurlMessageSender ¶
type Unfurler ¶
type Unfurler struct { sync.Mutex globals.Contextified utils.DebugLabeler // contains filtered or unexported fields }
func NewUnfurler ¶
func NewUnfurler(g *globals.Context, store attachments.Store, s3signer s3.Signer, storage types.UserConversationBackedStorage, sender UnfurlMessageSender, ri func() chat1.RemoteInterface) *Unfurler
func (*Unfurler) GetSettings ¶
func (*Unfurler) Prefetch ¶
func (u *Unfurler) Prefetch(ctx context.Context, uid gregor1.UID, convID chat1.ConversationID, msgText string) (numPrefetched int)
Prefetch attempts to parse hits out of `msgText` and scrape/package the unfurl so the result is cached.
func (*Unfurler) SetSettings ¶
func (*Unfurler) SetTestingRetryCh ¶
func (u *Unfurler) SetTestingRetryCh(ch chan struct{})
func (*Unfurler) SetTestingUnfurlCh ¶
func (*Unfurler) Status ¶
func (u *Unfurler) Status(ctx context.Context, outboxID chat1.OutboxID) (status types.UnfurlerTaskStatus, res *chat1.UnfurlResult, err error)
func (*Unfurler) UnfurlAndSend ¶
func (u *Unfurler) UnfurlAndSend(ctx context.Context, uid gregor1.UID, convID chat1.ConversationID, msg chat1.MessageUnboxed)
func (*Unfurler) WhitelistAdd ¶
func (*Unfurler) WhitelistAddExemption ¶
type WhitelistExemptionList ¶
func NewWhitelistExemptionList ¶
func NewWhitelistExemptionList() *WhitelistExemptionList
func (*WhitelistExemptionList) Add ¶
func (l *WhitelistExemptionList) Add(e types.WhitelistExemption)
func (*WhitelistExemptionList) Use ¶
func (l *WhitelistExemptionList) Use(convID chat1.ConversationID, msgID chat1.MessageID, domain string) bool
Source Files ¶
Click to show internal directories.
Click to hide internal directories.