pin

package
v0.0.2-0...-a5fe278 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package pin has types for describing pins (connection points).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Definition

type Definition struct {
	Name      string    `json:"-"`
	Type      string    `json:"type"`
	Direction Direction `json:"dir"`
}

Definition describes the main properties of a pin.

type Direction

type Direction string

Direction describes which way information flows in a Pin.

const (
	Input  Direction = "in"
	Output Direction = "out"
)

The various directions.

func (Direction) Type

func (d Direction) Type() string

Type returns either "<-chan" or "chan<-" (input or output).

type Map

type Map map[string]*Definition

Map is a map from pin names to pin definitions.

func NewMap

func NewMap(defs ...*Definition) Map

NewMap constructs a map out of definitions.

func (*Map) UnmarshalJSON

func (m *Map) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the map the usual way, and then calls FillNames.

Jump to

Keyboard shortcuts

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