python

package
v1.0.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Overview

This package is a pure-go implementation of a subset of features from python-betterproto (https://github.com/danielgtaylor/python-betterproto). Most of the logic here is translated directly from the original python code.

Index

Constants

This section is empty.

Variables

View Source
var Generator = generator{}

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Comment string `json:"comment"`
	Name    string `json:"name"`
	Value   any    `json:"value"`
}

type Enum

type Enum struct {
	Comment string  `json:"comment"`
	PyName  string  `json:"py_name"`
	Entries []Entry `json:"entries"`
}

type Field

type Field struct {
	FieldString string `json:"field_string"`
	Comment     string `json:"comment"`
}

type Message

type Message struct {
	Comment             string  `json:"comment"`
	Deprecated          bool    `json:"deprecated"`
	PyName              string  `json:"py_name"`
	HasDeprecatedFields bool    `json:"has_deprecated_fields"`
	DeprecatedFields    []Field `json:"deprecated_fields"`
	Fields              []Field `json:"fields"`
}

type Method

type Method struct {
	PyInputMessageParam string `json:"py_input_message_param"`
	Comment             string `json:"comment"`
	PyOutputMessageType string `json:"py_output_message_type"`
	PyInputMessageType  string `json:"py_input_message_type"`
	PyName              string `json:"py_name"`
	Route               string `json:"route"`
	PyInputMessage      string `json:"py_input_message"`
	ServerStreaming     bool   `json:"server_streaming"`
	ClientStreaming     bool   `json:"client_streaming"`
}

type Model

type Model struct {
	OutputFile *OutputFile `json:"output_file"`
}

type OutputFile

type OutputFile struct {
	InputFilenames          []string  `json:"input_filenames"`
	Imports                 []string  `json:"imports"`
	DatetimeImports         []string  `json:"datetime_imports"`
	PythonModuleImports     []string  `json:"python_module_imports"`
	ImportsTypeCheckingOnly []string  `json:"imports_type_checking_only"`
	TypingImports           []string  `json:"typing_imports"`
	Enums                   []Enum    `json:"enums"`
	Messages                []Message `json:"messages"`
	Services                []Service `json:"services"`
}

type Service

type Service struct {
	Comment string   `json:"comment"`
	PyName  string   `json:"py_name"`
	Methods []Method `json:"methods"`
}

Jump to

Keyboard shortcuts

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