Back to godoc.org

Command svcdec

v0.0.0-...-1557bcf
Latest Go to latest

The latest major version is .

Published: Aug 13, 2020 | License: Apache-2.0 | Module: github.com/luci/luci-go

Overview

Command svcdec stands for 'service decorator'. It reads a service interface XYZServer generated by protoc and generates DecoratedXYZ with this structure:

type DecoratedXYZ struct {
  Service XYZServer
  Prelude func(ctx context.Context, methodName string, req proto.Message) (context.Context, error)
}

DecoratedXYZ has the same methods as XYZServer: they call Prelude before forwarding the call to the corresponding XYZServer method.

svcdec is designed to be run through go generate:

//go:generate svcdec -type GreetServer
Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier