handler

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(file File) ([]byte, error)

Generate generates an event handler.

Types

type Event added in v0.1.0

type Event = gentypes.TypeRef

Event describes an event struct.

func Parse

func Parse(dir string, eventName string) (Event, error)

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

func ParseEvent added in v0.1.0

func ParseEvent(obj types.Object) (Event, error)

ParseEvent parses an object as an event.

type EventHandler added in v0.1.0

type EventHandler struct {
	Name  string
	Event gentypes.TypeRef
}

EventDispatcher describes an event handler.

func EventHandlerFromEvent added in v0.1.0

func EventHandlerFromEvent(event Event) EventHandler

EventHandlerFromEvent creates an EventHandler from an Event. nolint: golint

type File added in v0.1.0

type File struct {
	gentypes.File

	// EventHandlers represents event handlers to be generated for matching events.
	EventHandlers []EventHandler
}

File provides information for generating event handlers.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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