gokiwi

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrIndexOutOfBounds = errors.New("index out of bounds")

Functions

func CompileGo

func CompileGo(packageName string, schema *Schema, fields map[string][]ExtraField) string

Types

type Buffer

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

func NewBuffer

func NewBuffer(data []byte) *Buffer

func (*Buffer) ReadByte

func (b *Buffer) ReadByte() (byte, error)

func (*Buffer) ReadByteArray

func (b *Buffer) ReadByteArray() ([]byte, error)

func (*Buffer) ReadString

func (b *Buffer) ReadString() (string, error)

func (*Buffer) ReadVarFloat

func (b *Buffer) ReadVarFloat() (float64, error)

func (*Buffer) ReadVarInt

func (b *Buffer) ReadVarInt() (int, error)

func (*Buffer) ReadVarInt64

func (b *Buffer) ReadVarInt64() (int64, error)

func (*Buffer) ReadVarUint

func (b *Buffer) ReadVarUint() (uint, error)

func (*Buffer) ReadVarUint64

func (b *Buffer) ReadVarUint64() (uint64, error)

type Definition

type Definition struct {
	Name   string
	Line   int
	Column int
	Kind   DefinitionKind
	Fields []Field
}

type DefinitionKind

type DefinitionKind string
const (
	ENUM    DefinitionKind = "ENUM"
	STRUCT  DefinitionKind = "STRUCT"
	MESSAGE DefinitionKind = "MESSAGE"
)

type ExtraField

type ExtraField struct {
	TargetStruct string
	FieldName    string
	FieldType    string
}

type Field

type Field struct {
	Name         string
	Line         int
	Column       int
	RawType      *int
	Type         *Type
	IsArray      bool
	IsDeprecated bool
	Value        uint
}

type Schema

type Schema struct {
	Package     *string
	Definitions []Definition
}

func DecodeBinarySchema

func DecodeBinarySchema(data []byte) (*Schema, error)

type Type

type Type string
const (
	Bool   Type = "bool"
	Byte   Type = "byte"
	Int    Type = "int"
	Uint   Type = "uint"
	Float  Type = "float"
	String Type = "string"
	Int64  Type = "int64"
	Uint64 Type = "uint64"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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