Documentation ¶
Index ¶
- type ConfigCache
- type DbAdapter
- type MockConnection
- func (c *MockConnection) Close() error
- func (c *MockConnection) GetConfigObject(ctx context.Context, ref *configV1.ConfigRef) (*configV1.ConfigObject, error)
- func (c *MockConnection) GetMock() *r.Mock
- func (c *MockConnection) HasCrawledContent(ctx context.Context, revisitKey string) (*contentwriter.CrawledContent, error)
- func (c *MockConnection) WriteCrawledContent(ctx context.Context, crawledContent *contentwriter.CrawledContent) error
- type Options
- type RethinkDbConnection
- func (c *RethinkDbConnection) Close() error
- func (c *RethinkDbConnection) Connect() error
- func (c *RethinkDbConnection) GetConfigObject(ctx context.Context, ref *configV1.ConfigRef) (*configV1.ConfigObject, error)
- func (c *RethinkDbConnection) HasCrawledContent(ctx context.Context, payloadDigest string) (*contentwriter.CrawledContent, error)
- func (c *RethinkDbConnection) WriteCrawledContent(ctx context.Context, crawledContent *contentwriter.CrawledContent) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigCache ¶
type ConfigCache interface { GetConfigObject(context.Context, *configV1.ConfigRef) (*configV1.ConfigObject, error) HasCrawledContent(ctx context.Context, revisitKey string) (*contentwriter.CrawledContent, error) WriteCrawledContent(ctx context.Context, crawledContent *contentwriter.CrawledContent) error }
func NewConfigCache ¶
func NewConfigCache(db DbAdapter, ttl time.Duration) ConfigCache
type DbAdapter ¶
type DbAdapter interface { GetConfigObject(context.Context, *configV1.ConfigRef) (*configV1.ConfigObject, error) HasCrawledContent(ctx context.Context, revisitKey string) (*contentwriter.CrawledContent, error) WriteCrawledContent(ctx context.Context, crawledContent *contentwriter.CrawledContent) error }
type MockConnection ¶
type MockConnection struct {
*RethinkDbConnection
}
func NewMockConnection ¶
func NewMockConnection() *MockConnection
NewMockConnection creates a new mocked RethinkDbConnection object
func (*MockConnection) Close ¶
func (c *MockConnection) Close() error
func (*MockConnection) GetConfigObject ¶
func (c *MockConnection) GetConfigObject(ctx context.Context, ref *configV1.ConfigRef) (*configV1.ConfigObject, error)
func (*MockConnection) GetMock ¶
func (c *MockConnection) GetMock() *r.Mock
func (*MockConnection) HasCrawledContent ¶
func (c *MockConnection) HasCrawledContent(ctx context.Context, revisitKey string) (*contentwriter.CrawledContent, error)
func (*MockConnection) WriteCrawledContent ¶
func (c *MockConnection) WriteCrawledContent(ctx context.Context, crawledContent *contentwriter.CrawledContent) error
type RethinkDbConnection ¶
type RethinkDbConnection struct {
// contains filtered or unexported fields
}
RethinkDbConnection holds the database connection
func NewRethinkDbConnection ¶
func NewRethinkDbConnection(opts Options) *RethinkDbConnection
NewRethinkDbConnection creates a new RethinkDbConnection object
func (*RethinkDbConnection) Close ¶
func (c *RethinkDbConnection) Close() error
Close closes the RethinkDbConnection
func (*RethinkDbConnection) Connect ¶
func (c *RethinkDbConnection) Connect() error
Connect establishes connections
func (*RethinkDbConnection) GetConfigObject ¶
func (c *RethinkDbConnection) GetConfigObject(ctx context.Context, ref *configV1.ConfigRef) (*configV1.ConfigObject, error)
GetConfigObject fetches a config.ConfigObject referenced by a config.ConfigRef
func (*RethinkDbConnection) HasCrawledContent ¶
func (c *RethinkDbConnection) HasCrawledContent(ctx context.Context, payloadDigest string) (*contentwriter.CrawledContent, error)
func (*RethinkDbConnection) WriteCrawledContent ¶
func (c *RethinkDbConnection) WriteCrawledContent(ctx context.Context, crawledContent *contentwriter.CrawledContent) error
Click to show internal directories.
Click to hide internal directories.