Documentation
¶
Index ¶
- Variables
- func CopySessionMetadata(dst context.Context, src context.Context)
- func GetCollectionRef(ctx context.Context) (cid *configV1.ConfigRef)
- func GetConnectError(ctx context.Context) (err error)
- func GetCrawlExecutionId(ctx context.Context) (eid string)
- func GetHost(ctx context.Context) (host string)
- func GetIp(ctx context.Context) (ip string)
- func GetJobExecutionId(ctx context.Context) (jid string)
- func GetPort(ctx context.Context) (port string)
- func GetRequestId(ctx context.Context) (reqid string)
- func GetUri(ctx context.Context) (uri *url.URL)
- func HasStateHandle(ctx context.Context) bool
- func LogWithContext(ctx context.Context, componentName string) *logger.Logger
- func LogWithContextAndRequest(ctx context.Context, req *http.Request, componentName string) *logger.Logger
- func LogWithRecordContext(rc *RecordContext, componentName string) *logger.Logger
- func NewRequestContext(ctx context.Context, preserveSessionMetadata bool) context.Context
- func NewRequestContextFrom(ctx context.Context, source context.Context, preserveSessionMetadata bool) context.Context
- func OpenSessions() int64
- func RecordProxyDataAware(ctx context.Context) context.Context
- func RegisterConnectRequest(ctx context.Context, conn *serviceconnections.Connections, proxyId int32, ...)
- func ResetRequestState(ctx context.Context, preserveSessionMetadata bool)
- func SetCollectionRef(ctx context.Context, cid *configV1.ConfigRef)
- func SetConnectError(ctx context.Context, err error)
- func SetConnectErrorIfNotExists(ctx context.Context, err error)
- func SetCrawlExecutionId(ctx context.Context, eid string)
- func SetHost(ctx context.Context, host string)
- func SetIp(ctx context.Context, ip string)
- func SetJobExecutionId(ctx context.Context, jid string)
- func SetPort(ctx context.Context, port string)
- func SetRecordContext(ctx context.Context, rc *RecordContext)
- func SetRequestId(ctx context.Context, reqid string)
- func SetUri(ctx context.Context, uri *url.URL)
- func WithStateHandle(ctx context.Context, source context.Context) context.Context
- func WrapIfNecessary(ctx context.Context) context.Context
- type CwcSession
- type RecordContext
- func (rc *RecordContext) CancelContentWriter(msg string) error
- func (rc *RecordContext) Init(proxyId int32, conn *serviceconnections.Connections, req *http.Request, ...) *RecordContext
- func (rc *RecordContext) RegisterNewRequest(ctx context.Context) error
- func (rc *RecordContext) SaveCrawlLog() error
- func (rc *RecordContext) SendMeta() (reply *contentwriterV1.WriteReply, err error)
- func (rc *RecordContext) SendPayload(recNum int32, p []byte) error
- func (rc *RecordContext) SendProtocolHeader(recNum int32, p []byte) error
- func (rc *RecordContext) SendRequestError(ctx context.Context, reqErr error) error
- func (rc *RecordContext) SendResponseError(ctx context.Context, respErr error) error
- func (rc *RecordContext) Session() int64
Constants ¶
This section is empty.
Variables ¶
View Source
var AlreadyCompleted = errors.New("already completed")
Functions ¶
func CopySessionMetadata ¶ added in v0.8.0
func GetConnectError ¶
func GetCrawlExecutionId ¶
func GetJobExecutionId ¶
func GetRequestId ¶
func HasStateHandle ¶ added in v0.8.0
func LogWithRecordContext ¶
func LogWithRecordContext(rc *RecordContext, componentName string) *logger.Logger
func NewRequestContext ¶ added in v0.8.0
func NewRequestContextFrom ¶ added in v0.8.0
func OpenSessions ¶
func OpenSessions() int64
func RegisterConnectRequest ¶
func RegisterConnectRequest(ctx context.Context, conn *serviceconnections.Connections, proxyId int32, req *http.Request, uri *url.URL)
func ResetRequestState ¶ added in v0.8.0
func SetConnectError ¶
func SetCrawlExecutionId ¶
func SetJobExecutionId ¶
func SetRecordContext ¶
func SetRecordContext(ctx context.Context, rc *RecordContext)
func SetRequestId ¶
func WithStateHandle ¶ added in v0.8.0
Types ¶
type CwcSession ¶
type CwcSession struct {
contentwriterV1.ContentWriter_WriteClient
// contains filtered or unexported fields
}
type RecordContext ¶
type RecordContext struct {
Error error
CloseFunc func()
Method string
Uri *url.URL
RequestId string
CrawlExecutionId string
JobExecutionId string
CollectionRef *configV1.ConfigRef
IpAddress string
FetchTimesTamp time.Time
Meta *contentwriterV1.WriteRequest_Meta
CrawlLog *logV1.CrawlLog
ReplacementScript *configV1.BrowserScript
FoundInCache bool
PrecludedByRobots bool
HasExplicitHarvestHeaders bool
InitDone bool
ProxyId int32
// contains filtered or unexported fields
}
func GetRecordContext ¶
func GetRecordContext(ctx context.Context) (recordContext *RecordContext)
func NewRecordContext ¶
func NewRecordContext() *RecordContext
NewRecordContext creates a new RecordContext
func (*RecordContext) CancelContentWriter ¶
func (rc *RecordContext) CancelContentWriter(msg string) error
func (*RecordContext) Init ¶
func (rc *RecordContext) Init(proxyId int32, conn *serviceconnections.Connections, req *http.Request, uri *url.URL) *RecordContext
func (*RecordContext) RegisterNewRequest ¶
func (rc *RecordContext) RegisterNewRequest(ctx context.Context) error
func (*RecordContext) SaveCrawlLog ¶
func (rc *RecordContext) SaveCrawlLog() error
func (*RecordContext) SendMeta ¶
func (rc *RecordContext) SendMeta() (reply *contentwriterV1.WriteReply, err error)
func (*RecordContext) SendPayload ¶
func (rc *RecordContext) SendPayload(recNum int32, p []byte) error
func (*RecordContext) SendProtocolHeader ¶
func (rc *RecordContext) SendProtocolHeader(recNum int32, p []byte) error
func (*RecordContext) SendRequestError ¶
func (rc *RecordContext) SendRequestError(ctx context.Context, reqErr error) error
func (*RecordContext) SendResponseError ¶
func (rc *RecordContext) SendResponseError(ctx context.Context, respErr error) error
func (*RecordContext) Session ¶
func (rc *RecordContext) Session() int64
Click to show internal directories.
Click to hide internal directories.