dispatcher

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(pkg string, spec InterfaceSpec) (string, error)

Generate generates an event dispatcher.

Types

type InterfaceSpec

type InterfaceSpec struct {
	Name    string
	Package PackageSpec
	Methods []MethodSpec
}

InterfaceSpec describes the event dispatcher interface.

func Parse

func Parse(dir string, interfaceName string) (InterfaceSpec, error)

Parse parses a given package, looks for an interface and returns it as a normalized structure.

type MethodSpec

type MethodSpec struct {
	Name            string
	Event           TypeSpec
	ReceivesContext bool
	ReturnsError    bool
}

MethodSpec describes a dispatcher method in an event dispatcher.

type PackageSpec

type PackageSpec struct {
	Name string
	Path string
}

PackageSpec contains import information.

type TypeSpec

type TypeSpec struct {
	Name    string
	Package PackageSpec
}

TypeSpec represents a named type with import information.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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