tools

package
v0.0.0-...-b9d6643 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

These are not prod ready codes, but they are good enough. Skipping linters

Index

Constants

View Source
const OpcodeHeaderURL = `https://raw.githubusercontent.com/azerothcore/azerothcore-wotlk/master/src/server/game/Server/Protocol/Opcodes.h`

Variables

This section is empty.

Functions

func Fetch

func Fetch(url string) (io.Reader, error)

func WriteGoSource

func WriteGoSource(packageName string, enums []*Enum, out io.Writer, opts ...WriterOption) error

WriteGoSource writes a Go source file.

func WriteOpcodeSource

func WriteOpcodeSource(packageName string, opcodes []*OpcodeTemplate, out io.Writer) error

Types

type Enum

type Enum struct {
	Name   string
	Fields []EnumField
}

func ParseHeaderFile

func ParseHeaderFile(r io.Reader) []*Enum

type EnumField

type EnumField struct {
	Name  string
	Value string
}

type OpcodeTemplate

type OpcodeTemplate struct {
	Name    string
	Value   string
	Comment string
}

OpcodeTemplate parsed opcode holder struct.

func ParseOpcodes

func ParseOpcodes(r io.Reader) ([]*OpcodeTemplate, error)

type WriterOption

type WriterOption func(*writerConfig)

WriterOption is a function that can be passed to NewWriter.

func WithEndField

func WithEndField(use bool) WriterOption

WithEndField sets when the enum uses reference fields to the previous enum.

func WithSingleEnum

func WithSingleEnum(enumName string) WriterOption

WithSingleEnum sets whether this is a single enum.

Directories

Path Synopsis
dbc

Jump to

Keyboard shortcuts

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