You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package main
import (
"context""github.com/go-courier/logr""github.com/innoai-tech/infra/pkg/otel""github.com/innoai-tech/infra/pkg/cli"
)
varApp=cli.NewApp("app", "0.0.0")
funcinit() {
cli.AddTo(App, &Server{})
}
typeServerstruct {
// declare as sub command// tag component is special set// when define, --dump-k8s added, for dump kube app component cue files
cli.C`component:"server"`// singleton// with interface { InjectContext() context.Context },// we could get singleton from context
otel.Otel// Runner singleton// run once when cli execRunner// Server singleton// start serve when cli exec// if multi servers exists, will parallel serve.ServerOrAgent
}
typeRunnerstruct {
}
func (r*Runner) Run(ctx context.Context) error {
// get singleton from ctxlogr.FromContext(ctx).Info("run")
returnnil
}
typeServerOrAgentstruct {
// expose could be http/tcp/udp// generating services into cue files only when this setting defined.Addrstring`flag:",omitempty,expose=http"`
}
func (r*ServerOrAgent) Serve(ctx context.Context) error {
returnnil
}
func (r*ServerOrAgent) Shutdown(ctx context.Context) error {
returnnil
}