Documentation ¶
Index ¶
- type Option
- func WithBrowserHost(host string) Option
- func WithBrowserPort(port int) Option
- func WithConfigCache(dbAdapter database.ConfigCache) Option
- func WithLogWriter(lc logwriter.LogWriter) Option
- func WithProxyHost(host string) Option
- func WithProxyPort(port int) Option
- func WithScreenshotWriter(sw screenshotwriter.ScreenshotWriter) Option
- type Registry
- func (sr *Registry) CloseWait(timeout time.Duration)
- func (sr *Registry) CurrentSessions() int
- func (sr *Registry) Get(sessId int) *Session
- func (sr *Registry) GetNextAvailable(ctx context.Context) (*Session, error)
- func (sr *Registry) MaxSessions() int
- func (sr *Registry) NewDirectSession(uri, crawlExecutionId, jobExecutionId string) (*Session, error)
- func (sr *Registry) Release(sess *Session)
- type Session
- func (sess *Session) AbortFetch() error
- func (sess *Session) Context() context.Context
- func (sess *Session) Fetch(ctx context.Context, phs *frontierV1.PageHarvestSpec) (result *frontier.RenderResult, err error)
- func (sess *Session) GetReplacementScript(uri string) *configV1.BrowserScript
- func (sess *Session) Notify(reqId string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
SessionOption configures Session Registry.
func WithBrowserHost ¶
func WithBrowserPort ¶
func WithConfigCache ¶
func WithConfigCache(dbAdapter database.ConfigCache) Option
func WithLogWriter ¶
func WithProxyHost ¶
func WithProxyPort ¶
func WithScreenshotWriter ¶
func WithScreenshotWriter(sw screenshotwriter.ScreenshotWriter) Option
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func (*Registry) CurrentSessions ¶
func (*Registry) GetNextAvailable ¶
GetNextAvailable returns next session from the pool.
func (*Registry) MaxSessions ¶
func (*Registry) NewDirectSession ¶
type Session ¶
type Session struct { Id int UserAgent string Requests requests.RequestRegistry RequestedUrl *frontierV1.QueuedUri CrawlConfig *configV1.CrawlConfig PolitenessConfig *configV1.ConfigObject // contains filtered or unexported fields }
func (*Session) AbortFetch ¶
func (*Session) Fetch ¶
func (sess *Session) Fetch(ctx context.Context, phs *frontierV1.PageHarvestSpec) (result *frontier.RenderResult, err error)
func (*Session) GetReplacementScript ¶
func (sess *Session) GetReplacementScript(uri string) *configV1.BrowserScript
Click to show internal directories.
Click to hide internal directories.