@@ -15,17 +15,16 @@ import (
15
15
"time"
16
16
17
17
"github.com/rename-this/vhs/capture"
18
+ "github.com/rename-this/vhs/core"
18
19
"github.com/rename-this/vhs/file"
19
20
"github.com/rename-this/vhs/flow"
20
21
"github.com/rename-this/vhs/gcs"
21
22
"github.com/rename-this/vhs/gzipx"
22
23
"github.com/rename-this/vhs/httpx"
23
24
"github.com/rename-this/vhs/internal/ioutilx"
24
25
"github.com/rename-this/vhs/jsonx"
25
- "github.com/rename-this/vhs/middleware"
26
26
"github.com/rename-this/vhs/plugin"
27
27
"github.com/rename-this/vhs/s3compat"
28
- "github.com/rename-this/vhs/session"
29
28
"github.com/rename-this/vhs/tcp"
30
29
31
30
_ "net/http/pprof"
@@ -48,8 +47,8 @@ func newRootCmd() *cobra.Command {
48
47
Short : "A tool for capturing and recording network traffic." ,
49
48
}
50
49
51
- cfg = & session .Config {}
52
- flowCfg = & session .FlowConfig {}
50
+ cfg = & core .Config {}
51
+ flowCfg = & core .FlowConfig {}
53
52
inputLine string
54
53
outputLines []string
55
54
)
@@ -99,10 +98,10 @@ func newRootCmd() *cobra.Command {
99
98
return cmd
100
99
}
101
100
102
- func root (cfg * session .Config , flowCfg * session .FlowConfig , inputLine string , outputLines []string , parser * flow.Parser , logWriter io.Writer ) error {
101
+ func root (cfg * core .Config , flowCfg * core .FlowConfig , inputLine string , outputLines []string , parser * flow.Parser , logWriter io.Writer ) error {
103
102
var (
104
103
errs = make (chan error , errBufSize )
105
- ctx = session . NewContextsForWriter (cfg , flowCfg , errs , logWriter )
104
+ ctx = core . NewContextForWriter (cfg , flowCfg , errs , logWriter )
106
105
)
107
106
108
107
go func () {
@@ -210,13 +209,13 @@ func root(cfg *session.Config, flowCfg *session.FlowConfig, inputLine string, ou
210
209
return nil
211
210
}
212
211
213
- func startMiddleware (ctx session .Context ) (middleware .Middleware , error ) {
212
+ func startMiddleware (ctx core .Context ) (core .Middleware , error ) {
214
213
if ctx .FlowConfig .Middleware == "" {
215
214
ctx .Logger .Debug ().Msg ("no middleware configured" )
216
215
return nil , nil
217
216
}
218
217
219
- m , err := middleware . New (ctx , ctx .FlowConfig .Middleware )
218
+ m , err := core . NewMiddleware (ctx , ctx .FlowConfig .Middleware )
220
219
if err != nil {
221
220
return nil , fmt .Errorf ("failed to create middleware: %w" , err )
222
221
}
@@ -259,10 +258,10 @@ func defaultParser() *flow.Parser {
259
258
260
259
p .LoadSink ("gcs" , gcs .NewSink )
261
260
p .LoadSink ("s3compat" , s3compat .NewSink )
262
- p .LoadSink ("stdout" , func (_ session .Context ) (flow .Sink , error ) {
261
+ p .LoadSink ("stdout" , func (_ core .Context ) (core .Sink , error ) {
263
262
return os .Stdout , nil
264
263
})
265
- p .LoadSink ("discard" , func (_ session .Context ) (flow .Sink , error ) {
264
+ p .LoadSink ("discard" , func (_ core .Context ) (core .Sink , error ) {
266
265
return ioutilx .NopWriteCloser (ioutil .Discard ), nil
267
266
})
268
267
p .LoadSink ("tcp" , tcp .NewSink )
0 commit comments