protogen

package
v0.0.0-...-974a6ea Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PtrTo

func PtrTo[T any](val T) *T

func StartWithUpper

func StartWithUpper(s string) string

func ToProtoFieldName

func ToProtoFieldName(s string) string

func ToProtoIdentifier

func ToProtoIdentifier(s string) string

Types

type Comment

type Comment struct {
	Text string
}

Comment is a comment on a message/field

type Comments

type Comments struct {
	// contains filtered or unexported fields
}

Comments holds all the comments for our messages / fields

func (*Comments) GetComment

func (c *Comments) GetComment(key string) string

func (*Comments) SetComment

func (c *Comments) SetComment(key string, comment string)

type OpenAPIConverter

type OpenAPIConverter struct {

	// Comments holds field and message level comments
	Comments
	// contains filtered or unexported fields
}

func NewOpenAPIConverter

func NewOpenAPIConverter(protoPackageName string, doc *openapi.Document) *OpenAPIConverter

func (*OpenAPIConverter) Convert

type ProtoWriter

type ProtoWriter struct {
	// contains filtered or unexported fields
}

func NewProtoWriter

func NewProtoWriter(w io.Writer) *ProtoWriter

func (*ProtoWriter) Error

func (p *ProtoWriter) Error() error

func (*ProtoWriter) SetComments

func (p *ProtoWriter) SetComments(comments *Comments)

func (*ProtoWriter) SetProtoVersion

func (p *ProtoWriter) SetProtoVersion(protoVersion int)

func (*ProtoWriter) WriteFile

func (p *ProtoWriter) WriteFile(file protoreflect.FileDescriptor)

Jump to

Keyboard shortcuts

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