database

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 10 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

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

	SaveFeeds(ctx context.Context, feeds []*schema.Feed) error
	FindFeed(ctx context.Context, query model.FeedQuery) (*schema.Feed, *int, error)
	FindFeeds(ctx context.Context, query model.FeedsQuery) ([]*schema.Feed, 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 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 (
	DriverCockroachDB Driver = "cockroachdb"
	DriverPostgreSQL  Driver = "postgresql"
	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