diff --git a/submission/conn.go b/submission/conn.go deleted file mode 100644 index 37a9d74cbac7f42ab202c3639fc08fd9d97b8509..0000000000000000000000000000000000000000 --- a/submission/conn.go +++ /dev/null @@ -1,40 +0,0 @@ -package submission - -import ( - "context" - - ippb "git.autistici.org/ai3/tools/iprep/proto" - "google.golang.org/grpc" -) - -type client struct { - conn *grpc.ClientConn - stub ippb.SubmissionClient -} - -func newClient(addr string) (*client, error) { - conn, err := grpc.Dial(addr) - if err != nil { - return nil, err - } - return &client{ - conn: conn, - stub: ippb.NewSubmissionClient(conn), - }, nil -} - -func (c *client) Close() { - c.conn.Close() -} - -func (c *client) submit(ctx context.Context, ev *ippb.Event, aggr *ippb.Aggregate) error { - var req ippb.SubmitRequest - if ev != nil { - req.Events = append(req.Events, ev) - } - if aggr != nil { - req.Aggregates = append(req.Aggregates, aggr) - } - _, err := c.stub.Submit(ctx, &req) - return err -}