From 491c690fd2937d93b634de0d546c48fbbe1c8967 Mon Sep 17 00:00:00 2001 From: NikitaSkrynnik Date: Thu, 14 Nov 2024 19:55:34 +1100 Subject: [PATCH 1/2] remove deprecated APIs Signed-off-by: NikitaSkrynnik --- connection.go | 20 ++------------------ start.go | 8 +------- 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/connection.go b/connection.go index a9cdf8d..0a44080 100644 --- a/connection.go +++ b/connection.go @@ -39,7 +39,7 @@ type connection struct { // DialContext - Dials vpp and returns a Connection // DialContext is 'lazy' meaning that if there is no socket yet at filename, we will continue to try // until there is one or the ctx is canceled. -func DialContext(ctx context.Context, filename string) Connection { +func DialContext(ctx context.Context, filename string) api.Connection { c := &connection{ ready: make(chan struct{}), } @@ -100,23 +100,7 @@ func (c *connection) Invoke(ctx context.Context, req, reply api.Message) error { return c.Connection.Invoke(ctx, req, reply) } -func (c *connection) NewAPIChannel() (api.Channel, error) { - <-c.ready - if c.err != nil { - return nil, c.err - } - return c.Connection.NewAPIChannel() -} - -func (c *connection) NewAPIChannelBuffered(reqChanBufSize, replyChanBufSize int) (api.Channel, error) { - <-c.ready - if c.err != nil { - return nil, c.err - } - return c.Connection.NewAPIChannelBuffered(reqChanBufSize, replyChanBufSize) -} - -var _ Connection = &connection{} +var _ api.Connection = &connection{} func waitForSocket(ctx context.Context, filename string) error { watcher, err := fsnotify.NewWatcher() diff --git a/start.go b/start.go index 8aa62dc..50c3998 100644 --- a/start.go +++ b/start.go @@ -31,15 +31,9 @@ import ( "github.com/edwarnicke/log" ) -// Connection Combination of api.Connection and api.ChannelProvider -type Connection interface { - api.Connection - api.ChannelProvider -} - // StartAndDialContext - starts vpp // Stdout and Stderr for vpp are set to be log.Entry(ctx).Writer(). -func StartAndDialContext(ctx context.Context, opts ...Option) (conn Connection, errCh <-chan error) { +func StartAndDialContext(ctx context.Context, opts ...Option) (conn api.Connection, errCh <-chan error) { o := &option{ rootDir: DefaultRootDir, vppConfig: DefaultVPPConfTemplate, From bf458fb75fcebbe1ea3b1e2109f5f6ce4618943d Mon Sep 17 00:00:00 2001 From: NikitaSkrynnik Date: Thu, 14 Nov 2024 20:37:07 +1100 Subject: [PATCH 2/2] rerun CI Signed-off-by: NikitaSkrynnik