Move Message proto to types
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
This commit is contained in:
@@ -22,6 +22,7 @@ import (
|
||||
|
||||
api "github.com/containerd/containerd/v2/api/services/events/v1"
|
||||
apittrpc "github.com/containerd/containerd/v2/api/services/ttrpc/events/v1"
|
||||
"github.com/containerd/containerd/v2/api/types"
|
||||
"github.com/containerd/containerd/v2/pkg/events"
|
||||
"github.com/containerd/containerd/v2/pkg/events/exchange"
|
||||
"github.com/containerd/containerd/v2/plugins"
|
||||
@@ -114,8 +115,8 @@ func (s *service) Subscribe(req *api.SubscribeRequest, srv api.Events_SubscribeS
|
||||
}
|
||||
}
|
||||
|
||||
func toProto(env *events.Envelope) *api.Envelope {
|
||||
return &api.Envelope{
|
||||
func toProto(env *events.Envelope) *types.Envelope {
|
||||
return &types.Envelope{
|
||||
Timestamp: protobuf.ToTimestamp(env.Timestamp),
|
||||
Namespace: env.Namespace,
|
||||
Topic: env.Topic,
|
||||
@@ -123,7 +124,7 @@ func toProto(env *events.Envelope) *api.Envelope {
|
||||
}
|
||||
}
|
||||
|
||||
func fromProto(env *api.Envelope) *events.Envelope {
|
||||
func fromProto(env *types.Envelope) *events.Envelope {
|
||||
return &events.Envelope{
|
||||
Timestamp: protobuf.FromTimestamp(env.Timestamp),
|
||||
Namespace: env.Namespace,
|
||||
|
||||
@@ -20,6 +20,7 @@ import (
|
||||
"context"
|
||||
|
||||
api "github.com/containerd/containerd/v2/api/services/ttrpc/events/v1"
|
||||
"github.com/containerd/containerd/v2/api/types"
|
||||
"github.com/containerd/containerd/v2/pkg/events"
|
||||
"github.com/containerd/containerd/v2/pkg/events/exchange"
|
||||
"github.com/containerd/containerd/v2/protobuf"
|
||||
@@ -39,7 +40,7 @@ func (s *ttrpcService) Forward(ctx context.Context, r *api.ForwardRequest) (*pty
|
||||
return &ptypes.Empty{}, nil
|
||||
}
|
||||
|
||||
func fromTProto(env *api.Envelope) *events.Envelope {
|
||||
func fromTProto(env *types.Envelope) *events.Envelope {
|
||||
return &events.Envelope{
|
||||
Timestamp: protobuf.FromTimestamp(env.Timestamp),
|
||||
Namespace: env.Namespace,
|
||||
|
||||
Reference in New Issue
Block a user