genpjson

package
Version: v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2021 License: MIT Imports: 5 Imported by: 2

Documentation

Overview

Package genpjson generates golang type by protobuf file.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version of the generator.
	Version = "(unknown)"
	// WithoutOmitempty specifies that json tags will be generate without omitempty.
	WithoutOmitempty = false
)

Some variables as config of generator.

Functions

func GenerateFile

func GenerateFile(gen *protogen.Plugin, file *protogen.File) *protogen.GeneratedFile

GenerateFile generates golang file with JSON structs.

Types

type EnumInfo

type EnumInfo struct {
	*protogen.Enum
}

EnumInfo proto enum.

type FieldInfo

type FieldInfo struct {
	*protogen.Field

	JSONName string
}

FieldInfo proto field of message with canon JSON name.

type FileInfo

type FileInfo struct {
	*protogen.File

	Enums    []*EnumInfo
	Messages []*MessageInfo
}

FileInfo proto file with all enums and messages in "flattened ordering".

func GetFileInfo

func GetFileInfo(file *protogen.File) *FileInfo

GetFileInfo returns file info with all enums and messages.

type MessageInfo

type MessageInfo struct {
	*protogen.Message

	FieldsInfo []*FieldInfo
}

MessageInfo proto message with fields list.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL