generate

package
v0.0.0-...-a0b49e9 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2025 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Doc      string
	Tag      uint16
	Name     string
	Optional bool
	Type     string
}

Field describes a named value within a message.

type Message

type Message struct {
	Doc    string
	Method uint16
	Name   string
	Fields []Field
}

Message describes a protocol message.

type Protocol

type Protocol struct {
	Messages []Message
}

Protocol describes a protocol.

func ParseReader

func ParseReader(reader io.Reader) (*Protocol, error)

ParseReader parses a protocol definition from a reader.

func (*Protocol) Generate

func (this *Protocol) Generate(writer io.Writer, packag string) error

Generate turns this protocol into code. The package name for the generated code must be specified.

func (*Protocol) ResolveType

func (this *Protocol) ResolveType(hopp string) (string, error)

ResolveType resolves a HOPP type name to a Go type. For now, it supports all data types defined in TAPE.

func (*Protocol) UnmarshalText

func (this *Protocol) UnmarshalText(text []byte) error

UnmarshalText unmarshals markdown-formatted text data into the protocol.

Jump to

Keyboard shortcuts

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