protobuf

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Components2Proto

func Components2Proto(oa *oasmodel.OpenAPI, f io.Writer, packageName string, genOpts GenerationOptions, filternodes []string, options ...string) error

Components2Proto : generate proto file from Parsed OpenAPI definition

Types

type Enum

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

Enum simple type or reference (by-name)

func (*Enum) Declare

func (t *Enum) Declare(w io.Writer, indent string)

Declare : ProtoType interface realization

Example :
enum Corpus {
    UNIVERSAL = 0;
    WEB = 1;
    IMAGES = 2;
    LOCAL = 3;
    NEWS = 4;
    PRODUCTS = 5;
    VIDEO = 6;
  }

func (*Enum) Name

func (t *Enum) Name() string

Name : ProtoType interface realization

type GenerationOptions added in v1.0.10

type GenerationOptions struct {
	AddEnumPrefix bool
	AddMsgPrefix  bool
	PackageNames  map[string]string
	Imports       map[string]bool
}

Generation Options

type Map

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

Map object, used to represents AdditionalProperties

func (*Map) Declare

func (t *Map) Declare(w io.Writer, indent string)

Declare : ProtoType interface realization

func (*Map) Name

func (t *Map) Name() string

Name : ProtoType interface realization

type Message

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

Message structure

func (*Message) Declare

func (t *Message) Declare(w io.Writer, indent string)

Declare : ProtoType interface realization

func (*Message) Name

func (t *Message) Name() string

Name : ProtoType interface realization

type MessageMembers

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

MESSAGE

//Option for message fields

type Option struct {
	name  string
	value string
}

MessageMembers Message Field definition

func (*MessageMembers) Declare

func (t *MessageMembers) Declare(w io.Writer, indent string)

Declare : Message Member declaration

func (*MessageMembers) Name

func (t *MessageMembers) Name() string

Name : Member Name

type Oneof

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

Array : array of Prototype

func (*Oneof) Declare

func (t *Oneof) Declare(w io.Writer, indent string)

Declare : ProtoType interface realization

func (*Oneof) Name

func (t *Oneof) Name() string

Name : ProtoType interface realization

type ProtoType

type ProtoType interface {
	Declare(w io.Writer, indent string)
	Name() string
}

ProtoType Field Type protocol buffer interface

func CreateType

func CreateType(name string, schemaOrRef *oasmodel.SchemaOrRef, parent *Message, genOpts GenerationOptions) (ProtoType, error)

CreateType : convert OAS Schema to internal ProtoType

type TypeName

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

TypeName simple type or reference (by-name)

func (*TypeName) Declare

func (t *TypeName) Declare(w io.Writer, indent string)

Declare : ProtoType interface realization

func (*TypeName) Name

func (t *TypeName) Name() string

Name : ProtoType interface realization

Jump to

Keyboard shortcuts

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