firehose

package
v0.0.0-...-63584d6 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type Firehose

type Firehose struct {
	Hooks    []Hook
	Host     string
	StartSeq int64
	// contains filtered or unexported fields
}

func New

func New() *Firehose

func (*Firehose) Run

func (f *Firehose) Run(ctx context.Context) error

type Hook

type Hook struct {
	Name      string
	Predicate Predicate
	Action    func(ctx context.Context, commit *comatproto.SyncSubscribeRepos_Commit, op *comatproto.SyncSubscribeRepos_RepoOp, record cbg.CBORMarshaler)

	// CallPerCommit specifies if the hook expects to be called once per incoming commit.
	// By default a commit is unwrapped and the hook is called for each Op. If this flag
	// is set, then the hook is called just with the commit struct, op and record are not
	// provided.
	//
	// Note that predicates that look at the op or record will not work properly.
	CallPerCommit bool
}

type Predicate

func AllOf

func AllOf(predicates ...Predicate) Predicate

func AnyOf

func AnyOf(predicates ...Predicate) Predicate

func CreateOrUpdateOp

func CreateOrUpdateOp() Predicate

func DeleteOp

func DeleteOp() Predicate

func From

func From(did string) Predicate

func IsBlock

func IsBlock() Predicate

func IsFollow

func IsFollow() Predicate

func IsInCollection

func IsInCollection(collection string) Predicate

func IsPost

func IsPost() Predicate

func MentionsDID

func MentionsDID(did string) Predicate

func Not

func Not(predicate Predicate) Predicate

func SenderInSet

func SenderInSet(set didset.QueryableDIDSet) Predicate

func SenderNotInSet

func SenderNotInSet(set didset.QueryableDIDSet) Predicate

Jump to

Keyboard shortcuts

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