Skip to content
Snippets Groups Projects
Commit 6f5ab385 authored by ale's avatar ale
Browse files

Remove old broken file

parent 3805c5fb
Branches
No related tags found
No related merge requests found
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
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment