Documentation ¶
Index ¶
- func Generate(plugin *protogen.Plugin) error
- func GetServiceConfig() (*serviceconfig.Service, error)
- func NewGoModel(protoModel *protomodel.Model) (*gomodel.Model, error)
- func NewProtoModel(plugin *protogen.Plugin) (*protomodel.Model, error)
- func NewRESTBinding(methodName string, rule *annotations.HttpRule, index int) (*protomodel.RESTBinding, error)
- func NewRESTRequestPattern(rule *annotations.HttpRule) (*protomodel.RESTRequestPattern, error)
- func NewService(protoPackage string, descriptor *descriptorpb.ServiceDescriptorProto) *protomodel.Service
- func NewServiceBinding(service *protomodel.Service, method *descriptor.MethodDescriptorProto, ...) error
- func NewView(model *gomodel.Model) (*goview.View, error)
- type MixinFile
- type MixinService
- type Mixins
- type Namer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetServiceConfig ¶ added in v0.22.0
func GetServiceConfig() (*serviceconfig.Service, error)
GetServiceConfig reads and returns the Showcase service config file.
func NewGoModel ¶
func NewGoModel(protoModel *protomodel.Model) (*gomodel.Model, error)
NewGoModel creates a new goModel.Model from the given protomodel.Model. It essentially extracts and organizes the data needed to later generate Go source files.
func NewProtoModel ¶
func NewProtoModel(plugin *protogen.Plugin) (*protomodel.Model, error)
NewProtoModel uses the information in `plugin` to create a new protomodel.Model.
func NewRESTBinding ¶
func NewRESTBinding(methodName string, rule *annotations.HttpRule, index int) (*protomodel.RESTBinding, error)
NewRESTBinding creates a new protomodel.RESTBinding using the given methodName, rule, and index.
func NewRESTRequestPattern ¶
func NewRESTRequestPattern(rule *annotations.HttpRule) (*protomodel.RESTRequestPattern, error)
NewRESTRequestPattern creates a new protomodel.RESTRequestPattern by analyzing the rule provided.
func NewService ¶
func NewService(protoPackage string, descriptor *descriptorpb.ServiceDescriptorProto) *protomodel.Service
NewService creates a protomodel.Service from the given descriptor.
func NewServiceBinding ¶
func NewServiceBinding(service *protomodel.Service, method *descriptor.MethodDescriptorProto, rule *annotations.HttpRule, index int) error
NewServiceBinding adds `rule` (as the `index`th binding for `method`) to the specified `service`.
func NewView ¶
NewView creates a a new goview.View (a series of files to be output) from a gomodel.Model. The current approach is to generate one file per service, with that file containing all the service's RPCs. An additional file `genrest.go` is also created to register all these handlers with a gorilla/mux dispatcher.
Types ¶
type MixinFile ¶ added in v0.22.0
type MixinFile struct {
// contains filtered or unexported fields
}
MixinFile describes a single file containins methods to be mixed in.
type MixinService ¶ added in v0.22.0
type MixinService struct {
// contains filtered or unexported fields
}
MixinService describes a single service containing methods to be filled in
type Mixins ¶ added in v0.22.0
type Mixins []*MixinFile
Mixins is the collection of files containing methods to be mixed in.