Files
zeekayandHanzo Dev c16ed9fe26 Go 1.27.1, and the code it can say more simply
Modules declare go 1.27.1 and the build images follow. go fix applied the
modernizers; omitzero is not applied, since it changes what the JSON says.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-17 02:34:35 -07:00

39 lines
762 B
Go

package opamp
import (
"context"
"github.com/hanzoai/otel-collector/o11ycol"
"go.uber.org/zap"
)
type simpleClient struct {
baseClient
}
func NewSimpleClient(coll *o11ycol.WrappedCollector, logger *zap.Logger) *simpleClient {
return &simpleClient{
coll: coll,
err: make(chan error),
stopped: make(chan bool),
logger: logger.With(zap.String("component", "simple-client")),
}
}
func (c *simpleClient) Start(ctx context.Context) error {
c.logger.Info("Starting simple client")
err := c.coll.Run(ctx)
if err != nil {
return err
}
go c.ensureRunning()
return nil
}
func (c *simpleClient) Stop(ctx context.Context) error {
c.logger.Info("Stopping simple client")
close(c.stopped)
c.coll.Shutdown()
return <-c.coll.ErrorChan()
}