mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Add cdp support for xpath scrapers (#625)
Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
224
vendor/github.com/chromedp/cdproto/tethering/easyjson.go
generated
vendored
Normal file
224
vendor/github.com/chromedp/cdproto/tethering/easyjson.go
generated
vendored
Normal file
@@ -0,0 +1,224 @@
|
||||
// Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.
|
||||
|
||||
package tethering
|
||||
|
||||
import (
|
||||
json "encoding/json"
|
||||
easyjson "github.com/mailru/easyjson"
|
||||
jlexer "github.com/mailru/easyjson/jlexer"
|
||||
jwriter "github.com/mailru/easyjson/jwriter"
|
||||
)
|
||||
|
||||
// suppress unused package warning
|
||||
var (
|
||||
_ *json.RawMessage
|
||||
_ *jlexer.Lexer
|
||||
_ *jwriter.Writer
|
||||
_ easyjson.Marshaler
|
||||
)
|
||||
|
||||
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTethering(in *jlexer.Lexer, out *UnbindParams) {
|
||||
isTopLevel := in.IsStart()
|
||||
if in.IsNull() {
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
in.Skip()
|
||||
return
|
||||
}
|
||||
in.Delim('{')
|
||||
for !in.IsDelim('}') {
|
||||
key := in.UnsafeString()
|
||||
in.WantColon()
|
||||
if in.IsNull() {
|
||||
in.Skip()
|
||||
in.WantComma()
|
||||
continue
|
||||
}
|
||||
switch key {
|
||||
case "port":
|
||||
out.Port = int64(in.Int64())
|
||||
default:
|
||||
in.SkipRecursive()
|
||||
}
|
||||
in.WantComma()
|
||||
}
|
||||
in.Delim('}')
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
}
|
||||
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoTethering(out *jwriter.Writer, in UnbindParams) {
|
||||
out.RawByte('{')
|
||||
first := true
|
||||
_ = first
|
||||
{
|
||||
const prefix string = ",\"port\":"
|
||||
out.RawString(prefix[1:])
|
||||
out.Int64(int64(in.Port))
|
||||
}
|
||||
out.RawByte('}')
|
||||
}
|
||||
|
||||
// MarshalJSON supports json.Marshaler interface
|
||||
func (v UnbindParams) MarshalJSON() ([]byte, error) {
|
||||
w := jwriter.Writer{}
|
||||
easyjsonC5a4559bEncodeGithubComChromedpCdprotoTethering(&w, v)
|
||||
return w.Buffer.BuildBytes(), w.Error
|
||||
}
|
||||
|
||||
// MarshalEasyJSON supports easyjson.Marshaler interface
|
||||
func (v UnbindParams) MarshalEasyJSON(w *jwriter.Writer) {
|
||||
easyjsonC5a4559bEncodeGithubComChromedpCdprotoTethering(w, v)
|
||||
}
|
||||
|
||||
// UnmarshalJSON supports json.Unmarshaler interface
|
||||
func (v *UnbindParams) UnmarshalJSON(data []byte) error {
|
||||
r := jlexer.Lexer{Data: data}
|
||||
easyjsonC5a4559bDecodeGithubComChromedpCdprotoTethering(&r, v)
|
||||
return r.Error()
|
||||
}
|
||||
|
||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||
func (v *UnbindParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||
easyjsonC5a4559bDecodeGithubComChromedpCdprotoTethering(l, v)
|
||||
}
|
||||
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTethering1(in *jlexer.Lexer, out *EventAccepted) {
|
||||
isTopLevel := in.IsStart()
|
||||
if in.IsNull() {
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
in.Skip()
|
||||
return
|
||||
}
|
||||
in.Delim('{')
|
||||
for !in.IsDelim('}') {
|
||||
key := in.UnsafeString()
|
||||
in.WantColon()
|
||||
if in.IsNull() {
|
||||
in.Skip()
|
||||
in.WantComma()
|
||||
continue
|
||||
}
|
||||
switch key {
|
||||
case "port":
|
||||
out.Port = int64(in.Int64())
|
||||
case "connectionId":
|
||||
out.ConnectionID = string(in.String())
|
||||
default:
|
||||
in.SkipRecursive()
|
||||
}
|
||||
in.WantComma()
|
||||
}
|
||||
in.Delim('}')
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
}
|
||||
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoTethering1(out *jwriter.Writer, in EventAccepted) {
|
||||
out.RawByte('{')
|
||||
first := true
|
||||
_ = first
|
||||
{
|
||||
const prefix string = ",\"port\":"
|
||||
out.RawString(prefix[1:])
|
||||
out.Int64(int64(in.Port))
|
||||
}
|
||||
{
|
||||
const prefix string = ",\"connectionId\":"
|
||||
out.RawString(prefix)
|
||||
out.String(string(in.ConnectionID))
|
||||
}
|
||||
out.RawByte('}')
|
||||
}
|
||||
|
||||
// MarshalJSON supports json.Marshaler interface
|
||||
func (v EventAccepted) MarshalJSON() ([]byte, error) {
|
||||
w := jwriter.Writer{}
|
||||
easyjsonC5a4559bEncodeGithubComChromedpCdprotoTethering1(&w, v)
|
||||
return w.Buffer.BuildBytes(), w.Error
|
||||
}
|
||||
|
||||
// MarshalEasyJSON supports easyjson.Marshaler interface
|
||||
func (v EventAccepted) MarshalEasyJSON(w *jwriter.Writer) {
|
||||
easyjsonC5a4559bEncodeGithubComChromedpCdprotoTethering1(w, v)
|
||||
}
|
||||
|
||||
// UnmarshalJSON supports json.Unmarshaler interface
|
||||
func (v *EventAccepted) UnmarshalJSON(data []byte) error {
|
||||
r := jlexer.Lexer{Data: data}
|
||||
easyjsonC5a4559bDecodeGithubComChromedpCdprotoTethering1(&r, v)
|
||||
return r.Error()
|
||||
}
|
||||
|
||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||
func (v *EventAccepted) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||
easyjsonC5a4559bDecodeGithubComChromedpCdprotoTethering1(l, v)
|
||||
}
|
||||
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTethering2(in *jlexer.Lexer, out *BindParams) {
|
||||
isTopLevel := in.IsStart()
|
||||
if in.IsNull() {
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
in.Skip()
|
||||
return
|
||||
}
|
||||
in.Delim('{')
|
||||
for !in.IsDelim('}') {
|
||||
key := in.UnsafeString()
|
||||
in.WantColon()
|
||||
if in.IsNull() {
|
||||
in.Skip()
|
||||
in.WantComma()
|
||||
continue
|
||||
}
|
||||
switch key {
|
||||
case "port":
|
||||
out.Port = int64(in.Int64())
|
||||
default:
|
||||
in.SkipRecursive()
|
||||
}
|
||||
in.WantComma()
|
||||
}
|
||||
in.Delim('}')
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
}
|
||||
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoTethering2(out *jwriter.Writer, in BindParams) {
|
||||
out.RawByte('{')
|
||||
first := true
|
||||
_ = first
|
||||
{
|
||||
const prefix string = ",\"port\":"
|
||||
out.RawString(prefix[1:])
|
||||
out.Int64(int64(in.Port))
|
||||
}
|
||||
out.RawByte('}')
|
||||
}
|
||||
|
||||
// MarshalJSON supports json.Marshaler interface
|
||||
func (v BindParams) MarshalJSON() ([]byte, error) {
|
||||
w := jwriter.Writer{}
|
||||
easyjsonC5a4559bEncodeGithubComChromedpCdprotoTethering2(&w, v)
|
||||
return w.Buffer.BuildBytes(), w.Error
|
||||
}
|
||||
|
||||
// MarshalEasyJSON supports easyjson.Marshaler interface
|
||||
func (v BindParams) MarshalEasyJSON(w *jwriter.Writer) {
|
||||
easyjsonC5a4559bEncodeGithubComChromedpCdprotoTethering2(w, v)
|
||||
}
|
||||
|
||||
// UnmarshalJSON supports json.Unmarshaler interface
|
||||
func (v *BindParams) UnmarshalJSON(data []byte) error {
|
||||
r := jlexer.Lexer{Data: data}
|
||||
easyjsonC5a4559bDecodeGithubComChromedpCdprotoTethering2(&r, v)
|
||||
return r.Error()
|
||||
}
|
||||
|
||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||
func (v *BindParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||
easyjsonC5a4559bDecodeGithubComChromedpCdprotoTethering2(l, v)
|
||||
}
|
||||
12
vendor/github.com/chromedp/cdproto/tethering/events.go
generated
vendored
Normal file
12
vendor/github.com/chromedp/cdproto/tethering/events.go
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
package tethering
|
||||
|
||||
// Code generated by cdproto-gen. DO NOT EDIT.
|
||||
|
||||
// EventAccepted informs that port was successfully bound and got a specified
|
||||
// connection id.
|
||||
//
|
||||
// See: https://chromedevtools.github.io/devtools-protocol/tot/Tethering#event-accepted
|
||||
type EventAccepted struct {
|
||||
Port int64 `json:"port"` // Port number that was successfully bound.
|
||||
ConnectionID string `json:"connectionId"` // Connection id to be used.
|
||||
}
|
||||
65
vendor/github.com/chromedp/cdproto/tethering/tethering.go
generated
vendored
Normal file
65
vendor/github.com/chromedp/cdproto/tethering/tethering.go
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
// Package tethering provides the Chrome DevTools Protocol
|
||||
// commands, types, and events for the Tethering domain.
|
||||
//
|
||||
// The Tethering domain defines methods and events for browser port binding.
|
||||
//
|
||||
// Generated by the cdproto-gen command.
|
||||
package tethering
|
||||
|
||||
// Code generated by cdproto-gen. DO NOT EDIT.
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/chromedp/cdproto/cdp"
|
||||
)
|
||||
|
||||
// BindParams request browser port binding.
|
||||
type BindParams struct {
|
||||
Port int64 `json:"port"` // Port number to bind.
|
||||
}
|
||||
|
||||
// Bind request browser port binding.
|
||||
//
|
||||
// See: https://chromedevtools.github.io/devtools-protocol/tot/Tethering#method-bind
|
||||
//
|
||||
// parameters:
|
||||
// port - Port number to bind.
|
||||
func Bind(port int64) *BindParams {
|
||||
return &BindParams{
|
||||
Port: port,
|
||||
}
|
||||
}
|
||||
|
||||
// Do executes Tethering.bind against the provided context.
|
||||
func (p *BindParams) Do(ctx context.Context) (err error) {
|
||||
return cdp.Execute(ctx, CommandBind, p, nil)
|
||||
}
|
||||
|
||||
// UnbindParams request browser port unbinding.
|
||||
type UnbindParams struct {
|
||||
Port int64 `json:"port"` // Port number to unbind.
|
||||
}
|
||||
|
||||
// Unbind request browser port unbinding.
|
||||
//
|
||||
// See: https://chromedevtools.github.io/devtools-protocol/tot/Tethering#method-unbind
|
||||
//
|
||||
// parameters:
|
||||
// port - Port number to unbind.
|
||||
func Unbind(port int64) *UnbindParams {
|
||||
return &UnbindParams{
|
||||
Port: port,
|
||||
}
|
||||
}
|
||||
|
||||
// Do executes Tethering.unbind against the provided context.
|
||||
func (p *UnbindParams) Do(ctx context.Context) (err error) {
|
||||
return cdp.Execute(ctx, CommandUnbind, p, nil)
|
||||
}
|
||||
|
||||
// Command names.
|
||||
const (
|
||||
CommandBind = "Tethering.bind"
|
||||
CommandUnbind = "Tethering.unbind"
|
||||
)
|
||||
Reference in New Issue
Block a user