gatewaytypes

package
v0.0.0-...-3a625a3 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2018 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Method

type Method struct {
	Name    string `json:"name"`
	Args    *Type  `json:"args"`
	Returns *Type  `json:"returns"`
}

Method describes a single method of a Service. It has a name it is identified by and a set of arguments it accepts, as well as a single return value

type Service

type Service struct {
	Name    string            `json:"name"`
	Methods map[string]Method `json:"methods"`
}

Service describes an rpc service which has a set of methods it supports

type Type

type Type struct {
	TypeOf   reflect.Kind     `json:"typeOf,omitempty"`
	ArrayOf  *Type            `json:"arrayOf,omitempty"`
	ObjectOf map[string]*Type `json:"objectOf,omitempty"`

	// This is distinct from ObjectOf in that ObjectOf has specific keys it
	// supports, and each key has a specific type. A MapOf supports any key
	// (as long as it's a string) and all values must be of the given type
	MapOf *Type `json:"mapOf,omitempty"`

	// Used when the Type is recursive. Right now it's enough to simply say that
	// there is a cycle with no further information, in the future we may add
	// info about the cycle
	CycleOf *struct{} `json:"cycleOf,omitempty"`
}

Type describes a type. Only one of its fields should be a non-zero value, resulting in a tree structure. The leaves of the tree should all be TypeOf leaves.

We use the pointer to Type in all cases so that one Type may optionally embed another

Jump to

Keyboard shortcuts

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