mirror of
https://github.com/MontFerret/ferret.git
synced 2024-12-04 10:35:08 +02:00
move examples into separeted dirs (#495)
This commit is contained in:
parent
83fa54e65a
commit
f6b64c9294
@ -1,26 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/MontFerret/ferret/pkg/compiler"
|
||||
"github.com/MontFerret/ferret/pkg/drivers"
|
||||
"github.com/MontFerret/ferret/pkg/drivers/cdp"
|
||||
)
|
||||
|
||||
func run(q string) ([]byte, error) {
|
||||
comp := compiler.New()
|
||||
program := comp.MustCompile(q)
|
||||
|
||||
// create a root context
|
||||
ctx := context.Background()
|
||||
|
||||
// we inform the driver to keep cookies between queries
|
||||
ctx = drivers.WithContext(
|
||||
ctx,
|
||||
cdp.NewDriver(cdp.WithKeepCookies()),
|
||||
drivers.AsDefault(),
|
||||
)
|
||||
|
||||
return program.Run(ctx)
|
||||
}
|
Loading…
Reference in New Issue
Block a user