database

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Session
	Transaction
	DatasetMirrorPost
	DatasetFarcasterProfile
	DatasetENSNamehash
	DatasetMastodonHandle

	LoadCheckpoint(ctx context.Context, id string, network network.Network, worker string) (*engine.Checkpoint, error)
	LoadCheckpoints(ctx context.Context, id string, network network.Network, worker string) ([]*engine.Checkpoint, error)
	SaveCheckpoint(ctx context.Context, checkpoint *engine.Checkpoint) error

	SaveActivities(ctx context.Context, activities []*activityx.Activity, lowPriority bool) error
	FindActivity(ctx context.Context, query model.ActivityQuery) (*activityx.Activity, *int, error)
	FindActivities(ctx context.Context, query model.ActivitiesQuery) ([]*activityx.Activity, error)
	FindFederatedActivities(ctx context.Context, query model.FederatedActivitiesQuery) ([]*activityx.Activity, error)
	DeleteExpiredActivities(ctx context.Context, network network.Network, timestamp time.Time) error
}

type DatasetENSNamehash

type DatasetENSNamehash interface {
	LoadDatasetENSNamehash(ctx context.Context, hash common.Hash) (*model.ENSNamehash, error)
	SaveDatasetENSNamehash(ctx context.Context, namehash *model.ENSNamehash) error
}

type DatasetFarcasterProfile

type DatasetFarcasterProfile interface {
	LoadDatasetFarcasterProfile(ctx context.Context, fid int64) (*model.Profile, error)
	SaveDatasetFarcasterProfile(ctx context.Context, profile *model.Profile) error
}

type DatasetMastodonHandle added in v1.1.0

type DatasetMastodonHandle interface {
	SaveRecentMastodonHandles(ctx context.Context, handles []*model.MastodonHandle) error
	GetUpdatedMastodonHandles(ctx context.Context, query model.QueryMastodonHandles) ([]*model.MastodonHandle, error)
}

type DatasetMirrorPost

type DatasetMirrorPost interface {
	LoadDatasetMirrorPost(ctx context.Context, originContentDigest string) (*mirror_model.DatasetMirrorPost, error)
	SaveDatasetMirrorPost(ctx context.Context, post *mirror_model.DatasetMirrorPost) error
}

type Driver

type Driver string
const (
	DriverPostgreSQL Driver = "postgres"
	DriverMySQL      Driver = "mysql"
)

type Session

type Session interface {
	Migrate(ctx context.Context) error
	WithTransaction(ctx context.Context, transactionFunction func(ctx context.Context, client Client) error, transactionOptions ...*sql.TxOptions) error
	Begin(ctx context.Context, transactionOptions ...*sql.TxOptions) (Client, error)
}

type SugaredLogger

type SugaredLogger struct {
	Logger *zap.SugaredLogger
}

func (SugaredLogger) Fatalf

func (s SugaredLogger) Fatalf(format string, v ...interface{})

func (SugaredLogger) Printf

func (s SugaredLogger) Printf(format string, v ...interface{})

type Transaction

type Transaction interface {
	Rollback() error
	Commit() error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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