Documentation
¶
Overview ¶
Package greeter is the service's domain component: it serves HelloService over every public protocol with one implementation.
Index ¶
- Variables
- type Config
- type Greeter
- func (g *Greeter) Alive(context.Context) error
- func (g *Greeter) Countdown(req *hellov1.CountdownRequest, ...) error
- func (g *Greeter) Greet(ctx context.Context, req *hellov1.GreetRequest) (*hellov1.GreetResponse, error)
- func (g *Greeter) Ready(ctx context.Context) error
- func (g *Greeter) Register(r grpc.ServiceRegistrar)
- func (g *Greeter) Text(ctx context.Context, name string) (string, error)
Constants ¶
This section is empty.
Variables ¶
var ( ErrSalute = errors.New("salute must not be empty") ErrSuffix = errors.New("suffix must be at most 8 characters on one line") // ErrStalled: the report loop has not ticked for three periods. ErrStalled = errors.New("greeter: report loop stalled") )
Errors of Validate.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Salute string `json:"salute" schemapb:"default=Hello;description=Word before the name"`
// Live: editable from the console, applied without restart.
Suffix config.Live[string] `json:"suffix" schemapb:"default=!;description=Appended to every greeting"`
Excited config.Live[bool] `json:"excited" schemapb:"default=false"`
}
Config of the greeter.
type Greeter ¶
type Greeter struct {
hellov1.UnimplementedHelloServiceServer
deps.Component
// contains filtered or unexported fields
}
Greeter is a component: a named node with its own logger, tracer and meter.
func New ¶
New creates the greeter under parent; everything it needs is passed in, the events it raises it declares itself.
func (*Greeter) Alive ¶
Alive is the greeter's liveness check: the report loop, once started, keeps ticking.
func (*Greeter) Countdown ¶
func (g *Greeter) Countdown( req *hellov1.CountdownRequest, stream grpc.ServerStreamingServer[hellov1.CountdownResponse], ) error
Countdown implements HelloService.
func (*Greeter) Greet ¶
func (g *Greeter) Greet(ctx context.Context, req *hellov1.GreetRequest) (*hellov1.GreetResponse, error)
Greet implements HelloService.
func (*Greeter) Register ¶
func (g *Greeter) Register(r grpc.ServiceRegistrar)
Register is the one registration for native gRPC and ws-proto.