protoutils

package
v2.0.0-alpha.19 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Append

func Append(s *string, args ...string)

func CamelCase

func CamelCase(s string) string

CamelCase returns the CamelCased name. If there is an interior underscore followed by a lower case letter, drop the underscore and convert the letter to upper case. There is a remote possibility of this rewrite causing a name collision, but it's so remote we're prepared to pretend it's nonexistent - since the C++ generator lowercases names, it's extremely unlikely to have two fields with different capitalizations. In short, _my_field_name_2 becomes XMyFieldName_2.

func CodeFormat

func CodeFormat(buf *bytes.Buffer) (string, error)

CodeFormat go code format

func DefaultAPIOptions

func DefaultAPIOptions(pkg, srv, mth string) *options.HttpRule

DefaultAPIOptions This generates an HttpRule that matches the gRPC mapping to HTTP/2 described in https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests i.e.:

  • method is POST
  • path is "<pkg name>/<service name>/<method name>"
  • body should contain the serialized request message

func DefaultHttpRule

func DefaultHttpRule(name string) *options.HttpRule

func EachService

func EachService(fn func(desc protoreflect.FileDescriptor, srv protoreflect.ServiceDescriptor))

func EachServiceMethod

func EachServiceMethod(srv protoreflect.ServiceDescriptor, fn func(mth protoreflect.MethodDescriptor))

func ExtractHttpMethod

func ExtractHttpMethod(opts *options.HttpRule) (method, path string)

func GetExtension

func GetExtension[Option any](option protoreflect.ProtoMessage, xt protoreflect.ExtensionType) *Option

func GetService

func GetService(name string) protoreflect.ServiceDescriptor

func ParseParameter

func ParseParameter(args string)

func UnExport

func UnExport(s string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL