Documentation
¶
Overview ¶
Package gcp contains a GCP-based antispam implementation for Tessera.
A Spanner database provides a mechanism for maintaining an index of hash --> log position for detecting duplicate submissions.
Index ¶
Constants ¶
View Source
const ( DefaultMaxBatchSize = 1500 DefaultPushbackThreshold = 2048 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AntispamOpts ¶
type AntispamOpts struct { // MaxBatchSize is the largest number of mutations permitted in a single BatchWrite operation when // updating the antispam index. // // Larger batches can enable (up to a point) higher throughput, but care should be taken not to // overload the Spanner instance. // // During testing, we've found that 1500 appears to offer maximum throughput when using Spanner instances // with 300 or more PU. Smaller deployments (e.g. 100 PU) will likely perform better with smaller batch // sizes of around 64. MaxBatchSize uint // PushbackThreshold allows configuration of when to start responding to Add requests with pushback due to // the antispam follower falling too far behind. // // When the antispam follower is at least this many entries behind the size of the locally integrated tree, // the antispam decorator will return a wrapped tessera.ErrPushback for every Add request. PushbackThreshold uint }
AntispamOpts allows configuration of some tunable options.
type AntispamStorage ¶
type AntispamStorage struct {
// contains filtered or unexported fields
}
func NewAntispam ¶
func NewAntispam(ctx context.Context, spannerDB string, opts AntispamOpts) (*AntispamStorage, error)
NewAntispam returns an antispam driver which uses Spanner to maintain a mapping of previously seen entries and their assigned indices.
Note that the storage for this mapping is entirely separate and unconnected to the storage used for maintaining the Merkle tree.
This functionality is experimental!
Click to show internal directories.
Click to hide internal directories.